Merge pull request #69 from supabase-community/postgrest-version #11
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: cfn-publish-stable | |
on: | |
push: | |
tags: | |
- 'v*' | |
env: | |
BSS_FILE_ASSET_BUCKET_NAME: 'supabase-on-aws-${AWS::Region}' | |
BSS_FILE_ASSET_REGION_SET: us-east-1,us-west-2,eu-west-1,ap-northeast-1,ap-northeast-2,ap-northeast-3,ap-southeast-1,ap-southeast-2,ap-south-1 | |
jobs: | |
stable: | |
name: Stable CFn templates | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write # needed to interact with GitHub's OIDC Token endpoint. | |
contents: read | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Get the version tag | |
run: echo "TAG=${GITHUB_REF##*/}" >> $GITHUB_ENV | |
- name: node.js setup | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
- name: Install dependencies | |
run: yarn install --check-files | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v2 | |
with: | |
role-to-assume: ${{ secrets.CDK_PUBLISHING_ROLE }} | |
aws-region: us-west-2 | |
- name: cdk synth | |
run: npm run synth --no-version-reporting | |
env: | |
BSS_FILE_ASSET_PREFIX: stable/ | |
- name: remove old template | |
run: | | |
region_list=(${BSS_FILE_ASSET_REGION_SET//,/ }) | |
for region in ${region_list[@]}; do | |
bucket_name=(${BSS_FILE_ASSET_BUCKET_NAME//\$\{AWS::Region\}/$region}) | |
aws s3 rm s3://$bucket_name/stable/Supabase.template.json | |
done | |
- name: Publish assets | |
run: npx cdk-assets publish --path cdk.out/Supabase.assets.json --verbose | |
version: | |
name: Versioning CFn templates | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write # needed to interact with GitHub's OIDC Token endpoint. | |
contents: read | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Get the version tag | |
run: echo "TAG=${GITHUB_REF##*/}" >> $GITHUB_ENV | |
- name: node.js setup | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
- name: Install dependencies | |
run: yarn install --check-files | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v2 | |
with: | |
role-to-assume: ${{ secrets.CDK_PUBLISHING_ROLE }} | |
aws-region: us-west-2 | |
- name: cdk synth | |
run: npm run synth --no-version-reporting | |
env: | |
BSS_FILE_ASSET_PREFIX: ${{ env.TAG }}/ | |
- name: remove old template | |
run: | | |
region_list=(${BSS_FILE_ASSET_REGION_SET//,/ }) | |
for region in ${region_list[@]}; do | |
bucket_name=(${BSS_FILE_ASSET_BUCKET_NAME//\$\{AWS::Region\}/$region}) | |
aws s3 rm s3://$bucket_name/${{ env.TAG }}/Supabase.template.json | |
done | |
- name: Publish assets | |
run: npx cdk-assets publish --path cdk.out/Supabase.assets.json --verbose |