Skip to content

Commit

Permalink
Migrate UpdateRulesHistory Pipeline from Azure to GitHub (#1334)
Browse files Browse the repository at this point in the history
migrate "UpdateRulesHistory" on azure to github
  • Loading branch information
Aibono1225 authored May 9, 2024
1 parent e851b48 commit e439e6a
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/build-deploy-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ concurrency:

jobs:

syncHistory:
name: Sync Rules History
uses: ./.github/workflows/update-rules-history.yml
with:
branch_name: ${{ github.ref }}
environment: production
secrets: inherit

build:
name: Build
uses: ./.github/workflows/template-build.yml
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/update-rules-history.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Update Rules History

on:
workflow_call:
inputs:
branch_name:
required: true
type: string
environment:
type: string
required: true
description: 'The environment to build for'

jobs:
update-latest-rules-data:
name: Update latest rules data
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
steps:

- uses: actions/checkout@v4
name: Checkout SSW.Rules
with:
path: SSW.Rules
ref: ${{ inputs.branch_name }}
sparse-checkout: |
build-scripts
fetch-depth: 1

- uses: actions/checkout@v4
name: Checkout SSW.Rules.Content
with:
repository: SSWConsulting/SSW.Rules.Content
path: SSW.Rules.Content
ref: main
fetch-depth: 0

- name: Get Rule History Commits
shell: pwsh
run: |
./SSW.Rules/build-scripts/update-rule-history.ps1 `
-AzFunctionBaseUrl ${{ vars.AzFunctionBaseUrl }} `
-GetHistorySyncCommitHashKey ${{ secrets.GETHISTORYSYNCCOMMITHASHFUNCTIONKEY }} `
-UpdateRuleHistoryKey ${{ secrets.UPDATERULEHISTORYFUNCTIONKEY }} `
-UpdateHistorySyncCommitHashKey ${{ secrets.UPDATEHISTORYSYNCCOMMITHASHFUNCTIONKEY }}
- name: Update Latest Rules
shell: pwsh
run: |
./SSW.Rules/build-scripts/update-latest-rules.ps1 `
-AzFunctionBaseUrl ${{ vars.AzFunctionBaseUrl }} `
-UpdateLatestRulesFunctionKey ${{ secrets.UPDATELATESTRULESFUNCTIONKEY }}

0 comments on commit e439e6a

Please sign in to comment.