forked from quokka-astro/quokka
-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (75 loc) · 2.79 KB
/
Copy pathdocs.yml
File metadata and controls
89 lines (75 loc) · 2.79 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: 📖 Build and Deploy Docs
on:
push:
branches: [ development ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ development ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: ${{ github.ref }}-${{ github.head_ref }}-docs
cancel-in-progress: true
jobs:
check_changes:
uses: ./.github/workflows/check_changes.yml
with:
workflow_file: '.github/workflows/docs.yml'
build:
runs-on: ubuntu-latest
needs: check_changes
if: needs.check_changes.outputs.has_docs_changes == 'true' || needs.check_changes.outputs.has_api_docs_changes == 'true' || needs.check_changes.outputs.has_specific_workflow_changes == 'true'
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v4.2.2
with:
persist-credentials: false
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
- name: Install mdBook tooling
run: ./scripts/bash/install_mdbook.sh
- name: Install Doxygen
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -y doxygen
- name: Build documentation
run: |
./scripts/bash/docs_build.sh
./scripts/bash/docs_api_build.sh
- name: Archive artifact
shell: sh
run: |
chmod -c -R +rX "$INPUT_PATH" | while read line; do
echo "::warning title=Invalid file permissions automatically fixed::$line"
done
tar \
--dereference --hard-dereference \
--directory "$INPUT_PATH" \
-cvf "$RUNNER_TEMP/artifact.tar" \
--exclude=.git \
--exclude=.github \
.
env:
INPUT_PATH: ./docs/site
- name: Upload artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: 'github-pages'
path: ${{ runner.temp }}/artifact.tar
retention-days: 1
deploy:
if: github.event_name == 'push' && github.repository == 'quokka-astro/quokka' && github.ref == 'refs/heads/development' && (needs.check_changes.outputs.has_docs_changes == 'true' || needs.check_changes.outputs.has_api_docs_changes == 'true' || needs.check_changes.outputs.has_specific_workflow_changes == 'true')
environment:
name: github-pages
url: quokka-astro.github.io
runs-on: ubuntu-latest
needs: [build, check_changes]
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0