forked from supabase/postgres
-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (38 loc) · 1.28 KB
/
publish-migrations.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
name: Release Migrations
on:
push:
branches:
- develop
jobs:
build:
runs-on: [self-hosted, linux]
timeout-minutes: 15
permissions:
id-token: write
contents: read
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Merging migration files
run: cat $(ls -1) > ../migration-output.sql
working-directory: ${{ github.workspace }}/migrations/db/migrations
- name: configure aws credentials - staging
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.DEV_AWS_ROLE }}
aws-region: "ap-southeast-1"
- name: Deploy to S3 staging
shell: bash
run: aws s3 sync migrations/db s3://$AWS_S3_BUCKET/migrations/db --delete
env:
AWS_S3_BUCKET: ${{ secrets.PG_INIT_SCRIPT_S3_BUCKET_STAGING }}
- name: configure aws credentials - prod
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.PROD_AWS_ROLE }}
aws-region: "ap-southeast-1"
- name: Deploy to S3 prod
shell: bash
run: aws s3 sync migrations/db s3://$AWS_S3_BUCKET/migrations/db --delete
env:
AWS_S3_BUCKET: ${{ secrets.PG_INIT_SCRIPT_S3_BUCKET_PROD }}