Skip to content

Commit

Permalink
Merge pull request #123 from gradle/previews-refactoring
Browse files Browse the repository at this point in the history
Refactor workflow variable names
  • Loading branch information
oleg-nenashev authored Nov 14, 2024
2 parents 1204151 + bfa5d8a commit 45c97a9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ jobs:
pull-requests: write

env:
PR_PATH: ${{ github.event.repository.name }}/pull/${{github.event.number}}
DOMAIN: gradle.github.io
PREVIEW_DOMAIN: gradle.github.io
PREVIEW_REPO: community-site-preview
PREVIEW_PATH: ${{ github.event.repository.name }}/pull/${{github.event.number}}

steps:
- name: Checkout
Expand All @@ -47,7 +47,7 @@ jobs:
deploy_key: ${{ secrets.PREVIEW_DEPLOYMENT_KEY }}
external_repository: gradle/${{ env.PREVIEW_REPO }}
publish_dir: ./_site
destination_dir: ${{ env.PR_PATH }}
destination_dir: ${{ env.PREVIEW_PATH }}

- name: Update comment
uses: hasura/[email protected]
Expand All @@ -60,6 +60,6 @@ jobs:
message: >
A preview of ${{ github.event.after }} is uploaded and can be seen here:
✨ https://${{ env.DOMAIN }}/${{ env.PREVIEW_REPO }}/${{ env.PR_PATH}}/ ✨
✨ https://${{ env.PREVIEW_DOMAIN }}/${{ env.PREVIEW_REPO }}/${{ env.PREVIEW_PATH}}/ ✨
Changes may take a few minutes to propagate.
9 changes: 4 additions & 5 deletions .github/workflows/preview-cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ jobs:
delete_preview:
runs-on: ubuntu-20.04
env:
PR_PATH: ${{ github.event.repository.name }}/pull/${{github.event.number}}
DOMAIN: gradle.github.io
PREVIEW_DOMAIN: gradle.github.io
PREVIEW_REPO: community-site-preview
PREVIEW_PATH: ${{ github.event.repository.name }}/pull/${{github.event.number}}

permissions:
pull-requests: write
Expand All @@ -23,8 +23,7 @@ jobs:
with:
deploy_key: ${{ secrets.PREVIEW_DEPLOYMENT_KEY }}
external_repository: gradle/${{ env.PREVIEW_REPO }}
publish_dir: ./public
destination_dir: ${{ env.PR_PATH }}
destination_dir: ${{ env.PREVIEW_PATH }}

- name: Comment on PR
uses: hasura/[email protected]
Expand All @@ -34,4 +33,4 @@ jobs:
number: ${{ github.event.number }}
id: deploy-preview
message: >
🪓 PR closed, deleted preview at https://github.com/${{ env.PREVIEW_REPO }}/tree/gh-pages/${{ env.PR_PATH }}/
🪓 PR closed, deleted preview at https://github.com/${{ env.PREVIEW_REPO }}/tree/gh-pages/${{ env.PPREVIEW_PATH }}/

0 comments on commit 45c97a9

Please sign in to comment.