Skip to content

Commit

Permalink
add cleanup step
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Plischke committed Aug 29, 2024
1 parent 778c03b commit 2539284
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/deploy-pr-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
credentials_json: '${{ secrets.RUN_SA_KEY_DEV }}'

- name: Setup Google Cloud SDK
uses: 'google-github-actions/setup-gcloud@v2'
uses: google-github-actions/setup-gcloud@v2
with:
project_id: ${{ secrets.RUN_PROJECT_DEV }}
env:
Expand All @@ -65,17 +65,23 @@ jobs:
run: |
npm run build
- name: Deploy to Bucket
- name: Deploy
if: github.event.action != 'closed' # Skip if the PR was closed
working-directory: build
run: |-
gsutil -m rsync -R -d . ${{ secrets.GCS_DEV_BUCKET }}/${{ env.PREVIEW_PATH }}
- name: Deploy Message
if: success()
if: github.event.action != 'closed' # Skip if the PR was closed
uses: unsplash/comment-on-pr@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
msg: |
Deploy preview ready for ${{ github.event.number }}!
https://docs.dev.saucelabs.net/${{ env.PREVIEW_PATH }}
- name: Cleanup
if: github.event.action == 'closed' # Cleanup action only on PR closure
run: |-
gsutil rm -r ${{ secrets.GCS_DEV_BUCKET }}/${{ env.PREVIEW_PATH }}

0 comments on commit 2539284

Please sign in to comment.