Fix bracketing #118
Workflow file for this run
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
name: Docs | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
BuildAndDeploy: | |
name: Documentation | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Instantiate docs/ | |
shell: julia --color=yes {0} | |
run: | | |
using Pkg: Pkg | |
Pkg.activate("docs") | |
Pkg.instantiate() | |
- name: Build docs and deploy to the docs branch | |
shell: julia --color=yes {0} | |
run: | | |
using Pkg: Pkg | |
dir = pwd() | |
Pkg.activate("docs") | |
include(joinpath(dir, "docs", "make.jl")) | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
MonoDeploy: | |
needs: BuildAndDeploy | |
runs-on: ubuntu-latest | |
if: ${{ github.event_name != 'pull_request' }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: 'docs' | |
- uses: webfactory/ssh-agent@v0.9.0 | |
with: | |
ssh-private-key: ${{ secrets.DEPLOY_KEY }} | |
- name: Deploy to https://huijzer.xyz/PowerAnalyses.jl | |
shell: julia --color=yes {0} | |
run: | | |
from = "." | |
clone = mktempdir() | |
url = "git@github.com:rikhuijzer/huijzer.xyz.git" | |
run(`git clone --depth=1 $url $clone`) | |
to = joinpath(clone, "public", "PowerAnalyses.jl") | |
mkpath(to) | |
cp(from, to; force=true) | |
# To avoid Git submodules. | |
rm(joinpath(to, ".git"); recursive=true) | |
cd(clone) do | |
run(`git add .`) | |
run(`git config --global user.email 't.h.huijzer@rug.nl'`) | |
run(`git config --global user.name 'Bot'`) | |
run(`git commit --allow-empty -m 'Deploy from PowerAnalyses.jl'`) | |
run(`git push`) | |
end |