-
-
Notifications
You must be signed in to change notification settings - Fork 238
41 lines (34 loc) · 1.18 KB
/
publish-migrations-prod.yml
File metadata and controls
41 lines (34 loc) · 1.18 KB
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
name: Release Migrations - Prod
on:
workflow_dispatch:
jobs:
build:
runs-on: blacksmith-2vcpu-ubuntu-2404-arm
timeout-minutes: 15
permissions:
id-token: write
contents: read
steps:
- name: Guard
run: |
if [ $GITHUB_REF != 'refs/heads/develop' ]; then
echo "This action can only be run on the develop branch"
exit 1
fi
env:
GITHUB_REF: ${{ github.ref }}
- name: Checkout repo
uses: supabase/postgres/.github/actions/shared-checkout@HEAD
- name: Merging migration files
run: cat $(ls -1) > ../migration-output.sql
working-directory: ${{ github.workspace }}/migrations/db/migrations
- name: configure aws credentials - prod
uses: aws-actions/configure-aws-credentials@61815dcd50bd041e203e49132bacad1fd04d2708 # v5.1.1
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 }}