-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (48 loc) · 1.44 KB
/
prod.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: prod
on:
pull_request:
branches:
- release
types: [closed]
concurrency:
group: prod
cancel-in-progress: false
permissions: {}
jobs:
apply:
if: github.event.pull_request.merged == true
runs-on: ubuntu-22.04
permissions:
id-token: write
contents: read
pull-requests: write
steps:
- name: checkout project
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: setup terraform and gcloud CLI
uses: ./.github/actions/setup
with:
workload_identity_provider: ${{ secrets.PROD_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.PROD_SERVICE_ACCOUNT }}
- name: run terraform apply in prod
uses: ./.github/actions/tfcmd
with:
service: ${{ secrets.PROD_SERVICE }}
env: prod
command: apply -auto-approve
gh_token: ${{ secrets.GITHUB_TOKEN }}
slack:
if: always() && github.event.pull_request.merged == true
runs-on: ubuntu-22.04
needs: apply
permissions:
contents: read
steps:
- name: checkout project
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: send the workflow result to the slack channel
uses: ./.github/actions/slack
with:
conclusion: ${{ needs.apply.result }}
channel_id: ${{ vars.SLACK_CHANNEL_ID }}
webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}