From ff2958a8d29404d862a2b7a0d600646485f8088f Mon Sep 17 00:00:00 2001 From: Jorge Escobar <83969469+esfoobar-usds@users.noreply.github.com> Date: Wed, 2 Feb 2022 18:01:43 -0500 Subject: [PATCH] closed PR GHA --- .github/workflows/closed_pr.yml | 20 ++++++++++++++++++++ .github/workflows/deploy_main.yml | 2 -- 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/closed_pr.yml diff --git a/.github/workflows/closed_pr.yml b/.github/workflows/closed_pr.yml new file mode 100644 index 00000000..1867e72a --- /dev/null +++ b/.github/workflows/closed_pr.yml @@ -0,0 +1,20 @@ +name: Closed PR +on: + pull_request: + types: [ closed ] + paths: + - "client/**/*" +env: + PR_NUMBER: ${{ github.event.number }} +jobs: + remove-artifacts: + runs-on: ubuntu-latest + steps: + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.CLIENT_DEV_AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.CLIENT_DEV_AWS_SECRET_ACCESS_KEY }} + aws-region: us-east-1 + - name: Remove staging artifacts + run: aws s3 rm s3://usds-geoplatform-justice40-website/justice40-tool/ --exclude "*" --include "$(echo $PR_NUMBER)-*" --recursive diff --git a/.github/workflows/deploy_main.yml b/.github/workflows/deploy_main.yml index 49b4c36b..051942e6 100644 --- a/.github/workflows/deploy_main.yml +++ b/.github/workflows/deploy_main.yml @@ -87,8 +87,6 @@ jobs: AWS_REGION: "us-east-1" AWS_ACCESS_KEY_ID: ${{ secrets.CLIENT_DEV_AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.CLIENT_DEV_AWS_SECRET_ACCESS_KEY }} - - name: Remove staging artifacts - run: aws s3 rm s3://usds-geoplatform-justice40-website/justice40-tool/ --exclude "*" --include "$(echo $PR_NUMBER)-*" --recursive - name: Update PR with deployed URL uses: mshick/add-pr-comment@v1 with: