Skip to content

Commit 1d4b6fa

Browse files
committed
attempt to set up actions
1 parent 3d214b2 commit 1d4b6fa

File tree

2 files changed

+32
-36
lines changed

2 files changed

+32
-36
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Documentation
2+
3+
permissions:
4+
contents: write
5+
pages: write
6+
7+
on:
8+
push:
9+
branches:
10+
- main
11+
schedule:
12+
- cron: '0 0 * * *'
13+
workflow_dispatch:
14+
15+
jobs:
16+
build-docs:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v5
20+
- uses: julia-actions/setup-julia@v2
21+
with:
22+
version: '1'
23+
24+
- name: Install dependencies
25+
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(path="."); Pkg.instantiate()'
26+
27+
- name: Aggregate and deploy
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token
30+
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # For authentication with SSH deploy key
31+
run: julia --project=docs docs/make.jl

docs/make.jl

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -67,39 +67,4 @@ MultiDocumenter.make(
6767
sitemap = true,
6868
)
6969

70-
if "deploy" in ARGS
71-
@warn "Deploying to GitHub" ARGS
72-
gitroot = normpath(joinpath(@__DIR__, ".."))
73-
run(`git pull`)
74-
outbranch = "gh-pages"
75-
has_outbranch = true
76-
if !success(`git checkout $outbranch`)
77-
has_outbranch = false
78-
if !success(`git switch --orphan $outbranch`)
79-
@error "Cannot create new orphaned branch $outbranch."
80-
exit(1)
81-
end
82-
end
83-
for file in readdir(gitroot; join = true)
84-
endswith(file, ".git") && continue
85-
rm(file; force = true, recursive = true)
86-
end
87-
for file in readdir(outpath)
88-
cp(joinpath(outpath, file), joinpath(gitroot, file))
89-
end
90-
run(`git add .`)
91-
if success(`git commit -m 'Aggregate documentation'`)
92-
@info "Pushing updated documentation."
93-
if has_outbranch
94-
run(`git push`)
95-
else
96-
run(`git push -u origin $outbranch`)
97-
end
98-
run(`git checkout main`)
99-
else
100-
@info "No changes to aggregated documentation."
101-
end
102-
else
103-
# @info "Skipping deployment, 'deploy' not passed. Generated files in docs/out." ARGS
104-
# cp(outpath, joinpath(@__DIR__, "out"), force = true)
105-
end
70+
Documenter.deploydocs(; repo = "github.com/QuantumKitHub/QuantumKitHubDocs.jl.git", push_preview = true)

0 commit comments

Comments
 (0)