-
Notifications
You must be signed in to change notification settings - Fork 6
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
3 changed files
with
59 additions
and
4 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
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# from https://github.com/CliMA/ClimaTimeSteppers.jl | ||
# and https://github.com/JuliaPluto/computational-thinking-template | ||
|
||
name: Site Preview Cleanup | ||
|
||
on: | ||
pull_request: | ||
types: [closed] | ||
|
||
jobs: | ||
doc-preview-cleanup: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout gh-pages branch | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: output | ||
- name: Delete preview and history + push changes | ||
run: | | ||
if [ -d "previews/PR$PRNUM" ]; then | ||
git config user.name "Documenter.jl" | ||
git config user.email "[email protected]" | ||
git rm -rf "previews/PR$PRNUM" | ||
git commit -m "delete preview" | ||
git branch output-new $(echo "delete history" | git commit-tree HEAD^{tree}) | ||
git push --force origin output-new:output | ||
fi | ||
env: | ||
PRNUM: ${{ github.event.number }} |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: PR Comment # Write a comment in the PR with a link to the preview of the given website | ||
on: | ||
pull_request: | ||
types: [opened, reopened] | ||
jobs: | ||
pr_comment: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Create PR comment | ||
if: github.event_name == 'pull_request' && github.repository == github.event.pull_request.head.repo.full_name # if this is a pull request build AND the pull request is NOT made from a fork | ||
uses: thollander/actions-comment-pull-request@71efef56b184328c7ef1f213577c3a90edaa4aff | ||
with: | ||
message: 'Once the build has completed, you can preview your PR at this URL: https://${{ github.event.pull_request.base.repo.owner.login }}.github.io/${{ github.event.pull_request.base.repo.name }}/previews/PR${{ github.event.number }}/' | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |