infra: preview branches use self hosting #714
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: Destroy Preview Branch | |
on: | |
pull_request: | |
types: [closed] | |
# Require previous builds and deployments to finish before starting a new one | |
# Close can not run concurrently with Create or Update Infrastructure with Pulumi | |
concurrency: | |
group: pr-${{ github.event.pull_request.number }} | |
jobs: | |
teardown: | |
name: Destroy Pulumi Infrastructure Stack | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- uses: pulumi/actions@v4 | |
- name: Destroy Infrastructure Stack | |
working-directory: infra | |
run: | | |
npm ci | |
pulumi org set-default quadratic | |
STACK_NAME="preview-pr-${{ env.PR_ID }}" | |
pulumi stack select $STACK_NAME | |
pulumi config set aws:region us-west-2 | |
pulumi destroy -y --remove | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_DEVELOPMENT }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_DEVELOPMENT }} | |
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} | |
PR_ID: ${{ github.event.pull_request.number }} |