|
9 | 9 | branches: |
10 | 10 | - main |
11 | 11 |
|
| 12 | +concurrency: |
| 13 | + group: terraform-dev |
| 14 | + cancel-in-progress: false |
| 15 | + |
12 | 16 | jobs: |
13 | 17 | metadata: |
14 | 18 | name: "Set CI/CD metadata" |
@@ -100,10 +104,10 @@ jobs: |
100 | 104 | # just planning for now for safety and until review |
101 | 105 | run: | |
102 | 106 | mkdir -p ./build |
103 | | - echo "Running: make terraform env=$ENVIRONMENT workspace=$WORKSPACE stack=networking tf-command=plan" |
104 | | - make terraform env=$ENVIRONMENT stack=networking tf-command=plan workspace=$WORKSPACE |
105 | | - echo "Running: make terraform env=$ENVIRONMENT workspace=$WORKSPACE stack=api-layer tf-command=plan" |
106 | | - make terraform env=$ENVIRONMENT stack=api-layer tf-command=plan workspace=$WORKSPACE |
| 107 | + echo "Running: make terraform env=$ENVIRONMENT workspace=$WORKSPACE stack=networking tf-command=apply" |
| 108 | + make terraform env=$ENVIRONMENT stack=networking tf-command=apply workspace=$WORKSPACE |
| 109 | + echo "Running: make terraform env=$ENVIRONMENT workspace=$WORKSPACE stack=api-layer tf-command=apply" |
| 110 | + make terraform env=$ENVIRONMENT stack=api-layer tf-command=apply workspace=$WORKSPACE |
107 | 111 | working-directory: ./infrastructure |
108 | 112 |
|
109 | 113 | - name: "Tag the dev deployment" |
@@ -136,20 +140,14 @@ jobs: |
136 | 140 | # asset_path: ./build/lambda.zip |
137 | 141 | # asset_name: lambda-${{ needs.metadata.outputs.version }}.zip |
138 | 142 | # asset_content_type: application/zip |
139 | | - success: |
140 | | - name: "Success notification" |
141 | | - runs-on: ubuntu-latest |
142 | | - needs: [publish] |
143 | | - steps: |
144 | | - - name: "Check prerequisites for notification" |
145 | | - id: check |
146 | | - run: echo "secret_exist=${{ secrets.TEAMS_NOTIFICATION_WEBHOOK_URL != '' }}" >> $GITHUB_OUTPUT |
147 | | - - name: "Notify on publishing packages" |
148 | | - if: steps.check.outputs.secret_exist == 'true' |
149 | | - uses: nhs-england-tools/notify-msteams-action@v1.0.0 |
| 143 | + - name: "Notify Slack on PR merge" |
| 144 | + uses: slackapi/slack-github-action@v2.1.0 |
150 | 145 | with: |
151 | | - github-token: ${{ secrets.GITHUB_TOKEN }} |
152 | | - teams-webhook-url: ${{ secrets.TEAMS_NOTIFICATION_WEBHOOK_URL }} |
153 | | - message-title: "Notification title" |
154 | | - message-text: "This is a notification body" |
155 | | - link: ${{ github.event.pull_request.html_url }} |
| 146 | + webhook: ${{ secrets.SLACK_WEBHOOK_URL }} |
| 147 | + webhook-type: webhook-trigger |
| 148 | + payload: | |
| 149 | + status: "${{ job.status }}" |
| 150 | + link: "https://github.com/${{ github.repository }}/commit/${{ github.sha }}" |
| 151 | + Author: "${{ github.actor }}" |
| 152 | + title: "Pushed to main" |
| 153 | + version: "${{ needs.metadata.outputs.version }}" |
0 commit comments