Skip to content

Commit

Permalink
docs: deploy to multiple sites
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesCranmer committed Nov 7, 2024
1 parent cf4c0c2 commit 250574d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/Documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ on:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
target:
- repo: "github.com/MilesCranmer/SymbolicRegression.jl.git"
key: "astroautomata"
- repo: "github.com/ai-damtp-cam-ac-uk/symbolicregression.git"
key: "cam"
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@latest
Expand All @@ -28,8 +35,14 @@ jobs:
julia -e 'ENV["JULIA_PKG_SERVER"]=""; using Pkg; Pkg.update()'
- name: "Install dependencies"
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
- name: "Set DOCUMENTER_KEY based on target"
run: |
if [ "${{ matrix.target.key }}" == "astroautomata" ]; then
echo "DOCUMENTER_KEY=${{ secrets.DOCUMENTER_KEY }}" >> $GITHUB_ENV
elif [ "${{ matrix.target.key }}" == "cam" ]; then
echo "DOCUMENTER_KEY=${{ secrets.DAMTP_DEPLOY_KEY }}" >> $GITHUB_ENV
fi
- name: "Build and deploy"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # For authentication with SSH deploy key
TARGET_REPO: ${{ matrix.target.repo }}
run: julia --project=docs/ docs/make.jl
4 changes: 2 additions & 2 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ makedocs(;
strict=:doctest,
clean=true,
format=Documenter.HTML(;
canonical="https://astroautomata.com/SymbolicRegression.jl/stable"
canonical="https://ai.damtp.cam.ac.uk/symbolicregression/stable"
),
pages=[
"Contents" => "index_base.md",
Expand Down Expand Up @@ -146,5 +146,5 @@ open("docs/build/losses/index.html", "w") do io
end

if !haskey(ENV, "JL_LIVERELOAD")
deploydocs(; repo="github.com/MilesCranmer/SymbolicRegression.jl.git")
deploydocs(; repo=ENV["TARGET_REPO"])
end

0 comments on commit 250574d

Please sign in to comment.