Test action #1
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: TEST-ENV-CLEANUP | |
# Build and deploy test instance for every pull request | |
on: | |
pull_request: | |
types: [closed, unlabeled] | |
branches: ["**"] | |
jobs: | |
cleanup: | |
name: Remove test environment deployment | |
if: ${{ ((github.event.action == 'unlabeled') && (github.event.label.name == 'test deployment')) || ((github.event.action == 'closed') && contains(github.event.pull_request.labels.*.name, 'test deployment')) }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: rlespinasse/[email protected] | |
- name: Invoke deployment lambda | |
uses: gagoar/[email protected] | |
with: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
REGION: us-east-1 | |
FunctionName: test-env-manager | |
Payload: >- | |
{ | |
"action": "${{ github.event.action }}", | |
"label": "${{ env.GITHUB_HEAD_REF_SLUG_URL }}", | |
"image": "${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.us-east-1.amazonaws.com/saleor-testenvs:${{ env.GITHUB_HEAD_REF_SLUG_URL }}" | |
} | |
LogType: Tail | |
- name: Mark deployment as deactivated | |
uses: bobheadxi/[email protected] | |
with: | |
step: deactivate-env | |
token: ${{ secrets.GITHUB_TOKEN }} | |
env: ${{ env.GITHUB_HEAD_REF_SLUG_URL }} |