Skip to content

Commit 29bd5a8

Browse files
authored
build: update Documenter workflow (#249)
1 parent 0d53916 commit 29bd5a8

File tree

5 files changed

+83
-28
lines changed

5 files changed

+83
-28
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Cleanup Preview Documentation
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
7+
permissions:
8+
contents: write
9+
deployments: write
10+
11+
jobs:
12+
cleanup-preview-doc:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout gh-pages branch
16+
uses: actions/checkout@v4
17+
with:
18+
ref: gh-pages
19+
- name: Delete preview and history + push changes
20+
run: |
21+
if [ -d "previews/PR$PRNUM" ]; then
22+
git config user.name "Documenter.jl"
23+
git config user.email "[email protected]"
24+
git rm -rf "previews/PR$PRNUM"
25+
git commit -m "delete preview"
26+
git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree})
27+
git push --force origin gh-pages-new:gh-pages
28+
fi
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
PRNUM: ${{ github.event.number }}

.github/workflows/Documenter.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Documentation
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
branches:
8+
- 'master'
9+
pull_request:
10+
branches:
11+
- 'master'
12+
types:
13+
- opened
14+
- reopened
15+
- synchronize
16+
- ready_for_review
17+
18+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
19+
permissions:
20+
contents: write
21+
pages: write
22+
id-token: write
23+
statuses: write
24+
pull-requests: read # Required when using `push_preview=true`
25+
26+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
27+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
28+
concurrency:
29+
group: ${{ github.workflow }}-${{ github.ref }}
30+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
31+
32+
jobs:
33+
# Build job
34+
build:
35+
runs-on: ubuntu-latest
36+
steps:
37+
- uses: actions/checkout@v4
38+
- uses: julia-actions/setup-julia@v2
39+
with:
40+
version: 'lts'
41+
- uses: julia-actions/cache@v2
42+
- uses: julia-actions/julia-buildpkg@v1
43+
- uses: julia-actions/julia-docdeploy@v1
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token
46+
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # For authentication with SSH deploy key
47+
JULIA_DEBUG: "Documenter"
48+
DATADEPS_ALWAYS_ACCEPT: true
49+
GKSwstype: "100" # for Plots.jl plots (if you have them)

.github/workflows/Tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Tests
33
on:
44
push:
55
branches:
6-
- 'main'
6+
- 'master'
77
paths:
88
- '.github/workflows/Tests.yml'
99
- 'src/**'
@@ -12,7 +12,7 @@ on:
1212
- 'Project.toml'
1313
pull_request:
1414
branches:
15-
- 'main'
15+
- 'master'
1616
paths:
1717
- '.github/workflows/Tests.yml'
1818
- 'src/**'

.github/workflows/docs.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

docs/make.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ makedocs(
4949
),
5050
)
5151

52-
deploydocs(repo = "github.com/qojulia/QuantumCumulants.jl.git", push_preview = false)
52+
deploydocs(repo = "github.com/qojulia/QuantumCumulants.jl.git", push_preview = true)

0 commit comments

Comments
 (0)