diff --git a/.github/workflows/pull_request.yaml b/.github/workflows/pull_request.yaml index 6996a69..5652671 100644 --- a/.github/workflows/pull_request.yaml +++ b/.github/workflows/pull_request.yaml @@ -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 }} \ No newline at end of file + 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 }} \ No newline at end of file diff --git a/.github/workflows/serverless-deploy.yaml b/.github/workflows/serverless-deploy.yaml index c0a4d6d..4d814c3 100644 --- a/.github/workflows/serverless-deploy.yaml +++ b/.github/workflows/serverless-deploy.yaml @@ -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" \ No newline at end of file