Add workflow that builds & deploys examples and docs #4
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: Documentation Build | |
# read-only repo token | |
# no access to secrets | |
# TODO change trigger to manual after testing | |
on: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
# Install Julia | |
- uses: julia-actions/setup-julia@v1 | |
with: | |
version: 1 | |
arch: x64 | |
- uses: actions/cache@v3 | |
env: | |
cache-name: cache-artifacts | |
with: | |
path: ~/.julia/artifacts | |
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} | |
restore-keys: | | |
${{ runner.os }}-test-${{ env.cache-name }}- | |
${{ runner.os }}-test- | |
${{ runner.os }}- | |
- uses: julia-actions/julia-buildpkg@v1 | |
# Build examples and then docs | |
- name: 'Clone repos' | |
run: | | |
set -v | |
mkdir -p ./pr | |
echo "${{ github.event.number }}" > ./pr/NR | |
git clone https://github.com/qojulia/QuantumOptics.jl-examples | |
git clone https://github.com/qojulia/QuantumOptics.jl-documentation | |
- name: 'Build examples' | |
working-directory: ./QuantumOptics.jl-examples | |
run: | | |
pwd | |
set -v | |
julia -e ' | |
pwd() | |
using Pkg | |
Pkg.activate(".") | |
Pkg.instantiate() | |
Pkg.add("PyCall") | |
Pkg.build("PyCall") | |
Pkg.add("IJulia") | |
Pkg.build("IJulia") | |
pwd() | |
readdir() | |
include("make.jl") | |
' | |
- name: 'Build docs' | |
working-directory: ./QuantumOptics.jl-documentation | |
run: | | |
set -v | |
julia -e ' | |
using Pkg | |
Pkg.activate(".") | |
Pkg.instantiate() | |
include("make.jl") | |
' | |
# Push to complete build of documentation to FTP server | |
- name: 'Deploy' | |
uses: SamKirkland/[email protected] | |
with: | |
server: ${{ secrets.ftp_server_url }} | |
username: ${{ secrets.ftp_user }} | |
password: ${{ secrets.ftp_password }} | |
local-dir: ./build/ # TODO or is that ./QuantumOptics.jl-documentation/build/ ? | |