Skip to content

Commit

Permalink
chore: updated to use different ref name on preview creation; added c…
Browse files Browse the repository at this point in the history
…leanup action
  • Loading branch information
santilland committed Sep 25, 2023
1 parent 98f55d7 commit 7703a60
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/build_pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
uses: jakejarvis/[email protected]
env:
SOURCE_DIR: 'build'
DEST_DIR: 'catalog/${GITHUB_REF##*/}'
DEST_DIR: 'catalog/${GITHUB_REF_NAME}'
AWS_REGION: 'eu-central-1'
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/test_deploy_cleanup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Delete catalog test deployment when pull request is closed / deleted

on:
pull_request:
types:
- closed
branches:
- 'main'

jobs:
delete_folder:
runs-on: ubuntu-latest
steps:
# Set up AWS credentials
- name: Set up AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-central-1

# Delete the folder from the S3 bucket
- name: Delete folder from S3
run: |
aws s3 rm s3://${{ secrets.AWS_S3_BUCKET }}/catalog/${GITHUB_REF_NAME} --recursive

0 comments on commit 7703a60

Please sign in to comment.