feat: Complete Azure Stamps Pattern implementation with comprehensive… #1
Workflow file for this run
This file contains hidden or 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: Deploy Stamps Pattern | |
| on: | |
| push: | |
| branches: [ main, master ] | |
| paths: | |
| - 'AzureArchitecture/**' | |
| - '.github/workflows/deploy.yml' | |
| pull_request: | |
| branches: [ main, master ] | |
| paths: | |
| - 'AzureArchitecture/**' | |
| workflow_dispatch: | |
| inputs: | |
| environment: | |
| description: 'Environment to deploy to' | |
| required: true | |
| default: 'dev' | |
| type: choice | |
| options: | |
| - dev | |
| - test | |
| - prod | |
| env: | |
| AZURE_RESOURCEGROUP_NAME: rg-stamps-${{ github.event.inputs.environment || 'dev' }} | |
| AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
| BICEP_FILE_PATH: './AzureArchitecture/main.bicep' | |
| PARAMETERS_FILE_PATH: './AzureArchitecture/main.parameters.json' | |
| jobs: | |
| validate: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Azure Login | |
| uses: azure/login@v1 | |
| with: | |
| creds: ${{ secrets.AZURE_CREDENTIALS }} | |
| - name: Validate Bicep Template | |
| uses: azure/arm-deploy@v1 | |
| with: | |
| subscriptionId: ${{ env.AZURE_SUBSCRIPTION_ID }} | |
| resourceGroupName: ${{ env.AZURE_RESOURCEGROUP_NAME }} | |
| template: ${{ env.BICEP_FILE_PATH }} | |
| parameters: ${{ env.PARAMETERS_FILE_PATH }} | |
| deploymentMode: Validate | |
| deploy-dev: | |
| if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' | |
| needs: validate | |
| runs-on: ubuntu-latest | |
| environment: development | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Azure Login | |
| uses: azure/login@v1 | |
| with: | |
| creds: ${{ secrets.AZURE_CREDENTIALS }} | |
| - name: Create Resource Group | |
| run: | | |
| az group create \ | |
| --name ${{ env.AZURE_RESOURCEGROUP_NAME }} \ | |
| --location eastus \ | |
| --tags environment=dev project=StampsPattern | |
| - name: Deploy Bicep Template | |
| uses: azure/arm-deploy@v1 | |
| with: | |
| subscriptionId: ${{ env.AZURE_SUBSCRIPTION_ID }} | |
| resourceGroupName: ${{ env.AZURE_RESOURCEGROUP_NAME }} | |
| template: ${{ env.BICEP_FILE_PATH }} | |
| parameters: ${{ env.PARAMETERS_FILE_PATH }} | |
| deploymentName: stamps-pattern-${{ github.run_number }} | |
| deploy-prod: | |
| if: github.event.inputs.environment == 'prod' | |
| needs: validate | |
| runs-on: ubuntu-latest | |
| environment: production | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Azure Login | |
| uses: azure/login@v1 | |
| with: | |
| creds: ${{ secrets.AZURE_CREDENTIALS }} | |
| - name: Create Resource Group | |
| run: | | |
| az group create \ | |
| --name ${{ env.AZURE_RESOURCEGROUP_NAME }} \ | |
| --location eastus \ | |
| --tags environment=prod project=StampsPattern | |
| - name: Deploy Bicep Template | |
| uses: azure/arm-deploy@v1 | |
| with: | |
| subscriptionId: ${{ env.AZURE_SUBSCRIPTION_ID }} | |
| resourceGroupName: ${{ env.AZURE_RESOURCEGROUP_NAME }} | |
| template: ${{ env.BICEP_FILE_PATH }} | |
| parameters: ${{ env.PARAMETERS_FILE_PATH }} | |
| deploymentName: stamps-pattern-prod-${{ github.run_number }} |