Merge pull request #919 from govuk-one-login/FPAD-7860-Create-a-runbo… #53
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: 'Publish Alarm SAM Template to Dev Env' | |
| on: | |
| push: | |
| paths: | |
| - 'src/infra/alarm/**' | |
| - '.github/workflows/manual-publish-alarm-to-dev.yaml' | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| inputs: | |
| gitRef: | |
| description: 'Input branch name, commit SHA, or tag' | |
| required: true | |
| type: string | |
| default: main | |
| permissions: | |
| id-token: write | |
| contents: read | |
| jobs: | |
| validate_deployment: | |
| name: Deployment Template Checks | |
| uses: ./.github/workflows/validate-alarm-sam-template.yaml | |
| with: | |
| gitRef: ${{ inputs.gitRef }} | |
| secrets: | |
| githubActionsRoleARN: ${{ secrets.DEV_ALARM_GH_ACTIONS_ROLE_ARN }} | |
| publish_artifacts: | |
| name: 'Publish Template' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 60 | |
| needs: | |
| - validate_deployment | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # pin@v6.0.2 | |
| with: | |
| ref: ${{ inputs.gitRef }} | |
| - name: Configure AWS Credentials | |
| uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # pin@6.0.0 | |
| with: | |
| role-to-assume: ${{ secrets.DEV_ALARM_GH_ACTIONS_ROLE_ARN }} | |
| aws-region: eu-west-2 | |
| - name: 'Deploy SAM app' | |
| uses: govuk-one-login/devplatform-upload-action@b7bc01ed6e0b61d54f42e7f3d12dd3fdbb0f172a # pin@v3.13.0 | |
| with: | |
| artifact-bucket-name: ${{ secrets.DEV_ALARM_ARTIFACT_BUCKET_NAME }} | |
| signing-profile-name: ${{ secrets.DEV_SIGNING_PROFILE_NAME }} | |
| working-directory: ./src/infra/alarm/ | |
| template-file: template.yaml | |
| - name: 'Delegated Deployment via AWS CodeDeploy' | |
| run: echo "Deployment has been delegated to AWS CodeDeploy" |