File tree 2 files changed +42
-13
lines changed
2 files changed +42
-13
lines changed Original file line number Diff line number Diff line change
1
+ name : Release Migrations - Prod
2
+
3
+ on :
4
+ workflow_dispatch :
5
+
6
+ jobs :
7
+ build :
8
+ runs-on : [self-hosted, linux]
9
+ timeout-minutes : 15
10
+ permissions :
11
+ id-token : write
12
+ contents : read
13
+
14
+ steps :
15
+ - name : Guard
16
+ run : |
17
+ if [ $GITHUB_REF != 'refs/heads/develop' ]; then
18
+ echo "This action can only be run on the develop branch"
19
+ exit 1
20
+ fi
21
+ env :
22
+ GITHUB_REF : ${{ github.ref }}
23
+
24
+ - name : Checkout Repo
25
+ uses : actions/checkout@v2
26
+
27
+ - name : Merging migration files
28
+ run : cat $(ls -1) > ../migration-output.sql
29
+ working-directory : ${{ github.workspace }}/migrations/db/migrations
30
+
31
+ - name : configure aws credentials - prod
32
+ uses : aws-actions/configure-aws-credentials@v1
33
+ with :
34
+ role-to-assume : ${{ secrets.PROD_AWS_ROLE }}
35
+ aws-region : " ap-southeast-1"
36
+
37
+ - name : Deploy to S3 prod
38
+ shell : bash
39
+ run : aws s3 sync migrations/db s3://$AWS_S3_BUCKET/migrations/db --delete
40
+ env :
41
+ AWS_S3_BUCKET : ${{ secrets.PG_INIT_SCRIPT_S3_BUCKET_PROD }}
Original file line number Diff line number Diff line change 1
- name : Release Migrations
1
+ name : Release Migrations - Staging
2
2
3
3
on :
4
4
push :
32
32
run : aws s3 sync migrations/db s3://$AWS_S3_BUCKET/migrations/db --delete
33
33
env :
34
34
AWS_S3_BUCKET : ${{ secrets.PG_INIT_SCRIPT_S3_BUCKET_STAGING }}
35
-
36
- - name : configure aws credentials - prod
37
- uses : aws-actions/configure-aws-credentials@v1
38
- with :
39
- role-to-assume : ${{ secrets.PROD_AWS_ROLE }}
40
- aws-region : " ap-southeast-1"
41
-
42
- - name : Deploy to S3 prod
43
- shell : bash
44
- run : aws s3 sync migrations/db s3://$AWS_S3_BUCKET/migrations/db --delete
45
- env :
46
- AWS_S3_BUCKET : ${{ secrets.PG_INIT_SCRIPT_S3_BUCKET_PROD }}
You can’t perform that action at this time.
0 commit comments