-
Notifications
You must be signed in to change notification settings - Fork 6
87 lines (74 loc) · 2.48 KB
/
run-workflow-production.yml
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Run APM Workflow for Production
on:
workflow_dispatch:
permissions:
id-token: write
contents: read
jobs:
build-workflow:
name: Run APM Workflow
environment: production
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.workflow_run.head_branch }}
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: NPM install
working-directory: ./workflow-cli
run: npm ci
- name: Get AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
role-session-name: GitHub_to_AWS_via_FederatedOIDC
aws-region: ${{ vars.AWS_REGION }}
- name: Build workflow
working-directory: ./workflow-cli
run: npm run build
- name: Build Intention
run: sh ./.github/workflows/broker-intention.sh
env:
GITHUB_EVENT_PATH: ${{ github.event_path }}
- name: Open intention
uses: bcgov-nr/action-broker-intention-open@v2
with:
broker_jwt: ${{ secrets.BROKER_JWT }}
intention_path: workflow-cli/intention.json
quickstart: true
- name: Vault login
uses: bcgov-nr/action-broker-vault-login@v2
with:
action_token: ${{ env.ACTION_TOKEN_CONFIGURE }}
- name: workflow-cli opensearch-sync
working-directory: ./workflow-cli
env:
AWS_REGION: ${{ vars.AWS_REGION }}
OS_URL: apm.io.nrs.gov.bc.ca
OS_DOMAIN: nress-prod
AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_NUMBER }}
VAULT_ADDR: https://knox.io.nrs.gov.bc.ca
BROKER_TOKEN: ${{ secrets.BROKER_JWT }}
run: |
./bin/run opensearch-sync
- name: Revoke Vault Token Action
uses: bcgov-nr/action-broker-vault-revoke@v2
with:
vault_token: ${{ env.VAULT_TOKEN }}
- name: workflow-cli snapshot setup
working-directory: ./workflow-cli
env:
AWS_REGION: ${{ vars.AWS_REGION }}
OS_URL: apm.io.nrs.gov.bc.ca
OS_DOMAIN: nress-prod
AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_NUMBER }}
run: |
./bin/run snapshot setup
- name: Close intention
uses: bcgov-nr/action-broker-intention-close@v2
with:
intention_token: ${{ env.INTENTION_TOKEN }}