/ .github / workflows / docs.yml
docs.yml
 1  name: docs
 2  
 3  on:
 4    workflow_dispatch:
 5      inputs:
 6        debug_enabled:
 7          type: boolean
 8          description: "Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)"
 9          required: false
10          default: false
11    push:
12      tags:
13        - "v*"
14      branches: [main, master, develop]
15      paths:
16        - "docs/**"
17        - "*.md"
18        - ".github/workflows/docs.yml"
19    pull_request:
20      branches: [main, master, develop]
21      paths:
22        - "docs/**"
23        - "*.md"
24        - ".github/workflows/docs.yml"
25    schedule:
26      # Run weekly to catch issues with external dependencies
27      - cron: "0 0 * * 0"
28  
29  jobs:
30    build:
31      runs-on: ubuntu-latest
32      env:
33        CI: true
34        JULIA_VERSION: 1.11
35        JULIA_NOPRECOMP: "all"
36      permissions: write-all
37  
38      steps:
39        - uses: actions/checkout@v2
40        - name: Set up Julia
41          uses: julia-actions/setup-julia@v1
42          with:
43            version: "1"
44            include-all-prereleases: false
45        - uses: actions/cache@v3
46          id: julia-cache
47          if: always()
48          with:
49            path: |
50              ~/.julia
51              ~/.conda
52            key: ${{ runner.os }}-julia-${{ env.JULIA_VERSION }}-cache-${{ hashFiles('Planar/Project.toml') }}
53            restore-keys: |
54              ${{ runner.os }}-julia-${{ env.JULIA_VERSION }}-cache-${{ hashFiles('Planar/Project.toml') }}
55              ${{ runner.os }}-julia-${{ env.JULIA_VERSION }}-
56              ${{ runner.os }}-
57        - name: Setup tmate session
58          uses: mxschmitt/action-tmate@v3
59          if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
60        - name: CONDAPKG env var
61          run: |
62            echo "JULIA_CONDAPKG_ENV=$GITHUB_WORKSPACE/.conda" >> $GITHUB_ENV
63        - name: Install dependencies
64          run: |
65            sudo apt-get install -y xauth
66            # FIXME
67            # [ -e ~/.cache/Planar.jl/data ] && rm -r ~/.cache/Planar.jl/data
68            julia --project=Planar docs/setup.jl
69        - name: Build docs
70          run: |
71            # FIXME
72            # [ -e ~/.cache/Planar.jl/data ] && rm -r ~/.cache/Planar.jl/data
73            # export JULIA_CONDAPKG_OFFLINE=yes
74            julia --project=Planar docs/make.jl
75        - name: Checkout gh-pages branch
76          uses: actions/checkout@v3
77          with:
78            ref: gh-pages
79            path: ghpages
80        - name: Deploy docs
81          run: |
82            cd ghpages
83            rm -rf ./*
84            cp -r ../docs/build/* .
85            touch ./.nojekyll
86            git add .nojekyll
87            git add .
88            git config --local user.email "github-actions@users.noreply.github.com"
89            git config --local user.name "GitHub Actions"
90            git commit -m "Update documentation"
91            git push origin gh-pages