Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: teardown stack after pr #1

Merged
merged 6 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,15 @@ jobs:
- name: Run functional tests
run: echo "Running functional tests against ${{ needs.deploy-ephemeral.outputs.SERVICE_URL }}"
env:
SERVICE_URL: ${{ needs.deploy-ephemeral.outputs.SERVICE_URL }}
SERVICE_URL: ${{ needs.deploy-ephemeral.outputs.SERVICE_URL }}

teardown-ephemeral-env:
uses: ./.github/workflows/stack-delete.yaml
needs: run-functional-tests
permissions:
id-token: write
contents: read
secrets:
AWS_DEPLOYER_ROLE: ${{ secrets.AWS_DEPLOYER_ROLE }}
with:
ENVIRONMENT: ${{ github.actor }}-${{ github.event.pull_request.number }}
6 changes: 4 additions & 2 deletions .github/workflows/serverless-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,11 @@ jobs:
- name: seed_db
if: ${{ inputs.SHOULD_SEED_DB == true }}
run: npm run seed-db
- name: Do serverless info
run: npx serverless info --stage ${{ inputs.ENVIRONMENT }} --verbose
- id: set_service_url
name: Generate, mask, and output a secret
run: |
SERVICE_URL="$(npx serverless info --verbose | grep ServiceEndpoint | sed s/ServiceEndpoint\:\ //g)"
# echo "::add-mask::$SERVICE_URL"
SERVICE_URL="$(npx serverless info --stage ${{ inputs.ENVIRONMENT }} --verbose | grep ServiceEndpoint | sed s/ServiceEndpoint\:\ //g)"
echo "::add-mask::$SERVICE_URL"
echo "SERVICE_URL=$SERVICE_URL" >> "$GITHUB_OUTPUT"
Loading