Document assumption: all course sectionTypes are required for missing-section alert #521
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: Delete - Staging | |
| on: | |
| pull_request: | |
| types: [closed] | |
| repository_dispatch: | |
| types: [remove-command] | |
| concurrency: | |
| group: sst-staging-${{ github.event.pull_request.number || github.event.client_payload.pull_request.number }} | |
| cancel-in-progress: false | |
| env: | |
| AWS_REGION: ${{ secrets.AWS_REGION }} | |
| PROD_DB_URL: ${{ secrets.PROD_DB_URL }} | |
| DEV_DB_URL: ${{ secrets.DEV_DB_URL }} | |
| MAPBOX_ACCESS_TOKEN: ${{ secrets.MAPBOX_ACCESS_TOKEN }} | |
| ANTEATER_API_KEY: ${{ secrets.ANTEATER_API_KEY }} | |
| OIDC_CLIENT_ID: ${{ secrets.OIDC_CLIENT_ID }} | |
| OIDC_ISSUER_URL: ${{ secrets.OIDC_ISSUER_URL }} | |
| GOOGLE_REDIRECT_URI: ${{ secrets.GOOGLE_REDIRECT_URI }} | |
| PLANNER_CLIENT_API_KEY: ${{ secrets.PLANNER_CLIENT_API_KEY }} | |
| jobs: | |
| delete-staging: | |
| runs-on: ubuntu-latest | |
| env: | |
| SST_STAGE: staging-${{ github.event.pull_request.number || github.event.client_payload.pull_request.number }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha || github.event.client_payload.pull_request.head.sha }} | |
| - name: Set commit status as pending | |
| uses: myrotvorets/set-commit-status-action@master | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| status: pending | |
| sha: ${{ github.event.pull_request.head.sha || github.event.client_payload.pull_request.head.sha }} | |
| context: Delete Staging | |
| description: Removing staging environment for PR #${{ github.event.pull_request.number || github.event.client_payload.pull_request.number }} | |
| - name: Configure AWS credentials | |
| uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| aws-region: ${{ env.AWS_REGION }} | |
| - name: Setup Node.js and pnpm | |
| uses: ./.github/actions/setup-node-and-pnpm | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Remove SST staging stage | |
| run: | | |
| echo "Removing stage: $SST_STAGE" | |
| npx sst remove --stage "$SST_STAGE" | |
| - name: Set final commit status | |
| if: always() | |
| uses: myrotvorets/set-commit-status-action@master | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| status: ${{ job.status }} | |
| sha: ${{ github.event.pull_request.head.sha || github.event.client_payload.pull_request.head.sha }} | |
| context: Delete Staging | |
| description: ${{ job.status == 'success' && 'Staging environment removed' || 'Failed to remove staging environment' }} | |
| - name: Add reaction to comment | |
| if: github.event_name == 'repository_dispatch' | |
| uses: peter-evans/create-or-update-comment@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| comment-id: ${{ github.event.client_payload.github.payload.comment.id }} | |
| reactions: rocket |