Deployment to prod #22
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Whack-A-Mole Intagration | |
on: | |
push: | |
branches: [main] | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
versionize: | |
runs-on: ubuntu-latest | |
outputs: | |
semver: ${{ steps.gitversion.outputs.SemVer }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install GitVersion | |
uses: gittools/actions/gitversion/[email protected] | |
with: | |
versionSpec: "5.x" | |
- name: Determine Version | |
id: gitversion | |
uses: gittools/actions/gitversion/[email protected] | |
with: | |
useConfigFile: true | |
publish-bicep: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build & Push | |
working-directory: infrastructure | |
run: | | |
bicep build-params prod.main.bicepparam | |
bicep build-params test.main.bicepparam | |
az bicep build --file main.bicep | |
- name: Publish Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: bicep-templates | |
path: infrastructure/*.json | |
test-deployment: | |
needs: [publish-bicep, versionize] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: bicep-templates | |
path: ./infrastructure | |
- name: Az CLI login | |
uses: azure/login@v1 | |
with: | |
client-id: ${{ secrets.WAM_TST_CLIENT_ID }} | |
tenant-id: ${{ secrets.WAM_TST_TENANT_ID }} | |
subscription-id: ${{ secrets.WAM_TST_SUBSCRIPTION_ID }} | |
- name: Deploy Infrastructure | |
id: arm | |
uses: Azure/cli@v1 | |
with: | |
inlineScript: az deployment sub create --name wam-integration-northeur --location northeurope --template-file ./infrastructure/main.json --parameters ./infrastructure/test.main.json | |
production-deployment: | |
needs: [publish-bicep, versionize] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: bicep-templates | |
path: ./infrastructure | |
- name: Az CLI login | |
uses: azure/login@v1 | |
with: | |
client-id: ${{ secrets.WAM_PRD_CLIENT_ID }} | |
tenant-id: ${{ secrets.WAM_PRD_TENANT_ID }} | |
subscription-id: ${{ secrets.WAM_PRD_SUBSCRIPTION_ID }} | |
- name: Deploy Infrastructure | |
id: arm | |
uses: Azure/cli@v1 | |
with: | |
inlineScript: az deployment sub create --name wam-integration-northeur --location northeurope --template-file ./infrastructure/main.json --parameters ./infrastructure/prod.main.json |