Skip to content

Commit 6bcadf7

Browse files
committed
chore: improve migration workflows
1 parent 1f2520e commit 6bcadf7

File tree

2 files changed

+42
-1
lines changed

2 files changed

+42
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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 }}

.github/workflows/publish-migrations.yml .github/workflows/publish-migrations-staging.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Release Migrations
1+
name: Release Migrations - Staging
22

33
on:
44
push:

0 commit comments

Comments
 (0)