feat: add terraform apply job to release (#30) #13
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: Release (Production) | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
migrate: | |
runs-on: ubuntu-latest | |
env: | |
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }} | |
SUPABASE_DB_PASSWORD: ${{ secrets.PRODUCTION_DB_PASSWORD }} | |
SUPABASE_PROJECT_ID: ${{ secrets.PRODUCTION_PROJECT_ID }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: supabase/setup-cli@v1 | |
with: | |
version: latest | |
- run: supabase link --project-ref $SUPABASE_PROJECT_ID | |
- run: supabase db push | |
apply: | |
runs-on: ubuntu-latest | |
env: | |
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }} | |
TF_VAR_linked_project: ${{ secrets.PRODUCTION_PROJECT_ID }} | |
defaults: | |
run: | |
working-directory: supabase/remotes | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: hashicorp/setup-terraform@v3 | |
with: | |
terraform_wrapper: false | |
- run: terraform init | |
- run: terraform apply -auto-approve -no-color |