feat: persist sessions in PostgreSQL via Cloud SQL proxy sidecar #19
Workflow file for this run
This file contains hidden or 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: Preview Cleanup | |
| on: | |
| pull_request: | |
| types: [closed] | |
| permissions: | |
| contents: read | |
| id-token: write | |
| deployments: write | |
| jobs: | |
| cleanup: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - id: 'auth' | |
| uses: 'google-github-actions/auth@v2' | |
| with: | |
| workload_identity_provider: '${{ secrets.GC_WORKLOAD_IDENTITY_PROVIDER }}' | |
| service_account: '${{ secrets.GC_SERVICE_ACCOUNT }}' | |
| - name: Set up Cloud SDK | |
| uses: google-github-actions/setup-gcloud@v2 | |
| - name: Remove Preview Traffic Tag | |
| run: | | |
| gcloud run services update-traffic cofacts-ai \ | |
| --region asia-east1 \ | |
| --remove-tags="pr-${{ github.event.number }}" || echo "Tag not found or service does not exist, skipping." | |
| - name: Delete GitHub Environment | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const environment_name = `pr-${context.issue.number}`; | |
| const { owner, repo } = context.repo; | |
| await github.rest.repos.deleteAnEnvironment({ | |
| owner, | |
| repo, | |
| environment_name, | |
| }); |