-
Notifications
You must be signed in to change notification settings - Fork 10
49 lines (47 loc) · 1.63 KB
/
docs.yml
File metadata and controls
49 lines (47 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Documentation
on:
push:
branches:
- main # update to match your development branch (master, main, dev, trunk, ...)
tags: '*'
pull_request:
jobs:
build:
# These permissions are needed to:
# - Deploy the documentation: https://documenter.juliadocs.org/stable/man/hosting/#Permissions
# - Delete old caches: https://github.com/julia-actions/cache#usage
permissions:
actions: write
contents: write
pull-requests: read
statuses: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: '1'
- uses: julia-actions/cache@v2
- name: Install dependencies
shell: julia --color=yes --project=docs {0}
run: |
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()
- name: Build and deploy
run: julia --color=yes --project=docs docs/make.jl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # If authenticating with GitHub Actions token
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
- name: Copy llms.txt to docs root
if: github.ref == 'refs/heads/main'
run: |
cp docs/src/llms.txt /tmp/llms.txt
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git fetch origin gh-pages
git checkout -f gh-pages
cp /tmp/llms.txt llms.txt
git add llms.txt
git diff --staged --quiet || git commit -m "Update llms.txt at docs root"
git push origin gh-pages