-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
36 additions
and
8 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,15 +9,16 @@ jobs: | |
env: | ||
PR_PATH: pull/${{github.event.number}} | ||
steps: | ||
- name: make empty dir | ||
run: mkdir ${{ env.PR_PATH }} | ||
|
||
- name: delete folder | ||
uses: peaceiris/actions-gh-pages@v3 | ||
- name: Checkout website repo | ||
uses: actions/checkout@v4 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ${{ env.PR_PATH }} | ||
destination_dir: ${{ env.PR_PATH }} | ||
ref: gh-pages | ||
|
||
- name: Delete preview | ||
run: | | ||
git rm -r ${{ env.PR_PATH }} | ||
git commit -m "Delete preview for PR #${{ github.event.number }}" | ||
git push origin gh-pages | ||
- name: Comment on PR | ||
uses: hasura/[email protected] | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ jobs: | |
runs-on: ubuntu-latest | ||
env: | ||
PR_PATH: pull/${{github.event.number}} | ||
BASE_URL: https://dipy.github.io/dipy.org | ||
steps: | ||
- name: Comment on PR | ||
uses: hasura/[email protected] | ||
|
@@ -58,4 +59,30 @@ jobs: | |
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./_build/html | ||
user_name: 'github-actions[bot]' | ||
user_email: 'github-actions[bot]@users.noreply.github.com' | ||
commit_message: ${{ github.event.head_commit.message }} | ||
# cname: ${{ env.DOMAIN # TODO: set this if you're using a custom domain. | ||
|
||
- name: Deploy to PR preview | ||
uses: peaceiris/actions-gh-pages@v3 | ||
if: github.ref != 'refs/heads/master' | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./_build/html | ||
destination_dir: ${{ env.PR_PATH }} | ||
keep_files: true | ||
user_name: 'github-actions[bot]' | ||
user_email: 'github-actions[bot]@users.noreply.github.com' | ||
commit_message: ${{ github.event.head_commit.message }} | ||
|
||
- name: Update comment | ||
uses: hasura/[email protected] | ||
if: github.ref != 'refs/heads/master' | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
repository: ${{ github.repository }} | ||
number: ${{ github.event.number }} | ||
id: deploy-preview | ||
message: "A preview of ${{ github.event.after }} is uploaded and can be seen here:\n\n ✨ ${{ env.BASE_URL }}/${{ env.PR_PATH }} ✨\n\nChanges may take a few minutes to propagate. The source is here: https://github.com/${{ github.repository }}/tree/gh-pages/${{ env.PR_PATH }}/" | ||
|