Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions .github/workflows/Documenter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Documentation
on:
pull_request:
paths:
- '.github/workflows/Documenter.yml'
- '.github/workflows/Documenter.yaml'
- 'docs/**'
- 'lib/**'
- 'src/**'
Expand All @@ -12,21 +12,27 @@ on:
- main
tags: '*'
paths:
- '.github/workflows/Documenter.yml'
- '.github/workflows/Documenter.yaml'
- 'docs/**'
- 'lib/**'
- 'src/**'

concurrency:
# Skip intermediate builds: always.
# Cancel intermediate builds: only if it is a pull request build.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
# Same group concurrency as the `PreviewCleanup.yml` workflow, because they both
# git-push to the same branch, so we want to avoid clashes. NOTE: this is
# different from the concurrency group below, which is to cancel successive
# jobs from within the PR.
group: docs-pushing

jobs:
docs:
name: Documentation
runs-on: ubuntu-latest
concurrency:
# Skip intermediate builds: always.
# Cancel intermediate builds: only if it is a pull request build.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/PreviewCleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Doc Preview Cleanup

on:
pull_request:
types: [closed]

concurrency:
# Same group concurrency as the `docs.yml` workflow, because they both
# git-push to the same branch, so we want to avoid clashes.
group: docs-pushing

jobs:
doc-preview-cleanup:
runs-on: ubuntu-latest
steps:
- name: Checkout gh-pages branch
uses: actions/checkout@v4
with:
ref: gh-pages
- name: Delete preview and history + push changes
run: |
preview_directory=preview/PR${{ github.event.number }}
if [[ -d "${preview_directory}" ]]; then
git config user.name "${{github.actor}}"
git config user.email "${{github.actor_id}}+${{github.actor}}@users.noreply.github.com"
git rm -rf "${preview_directory}"
git commit -m 'Cleanup docs for PR #${{ github.event.number }}'
git branch gh-pages-new $(echo "Delete history" | git commit-tree HEAD^{tree})
git push --force origin gh-pages-new:gh-pages
fi
Loading