-
Notifications
You must be signed in to change notification settings - Fork 22
90 lines (78 loc) · 2.65 KB
/
Copy pathbuild-docs.yml
File metadata and controls
90 lines (78 loc) · 2.65 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
90
name: Build and deploy Docs
on:
pull_request:
workflow_dispatch: # Allows manual triggering from the Actions tab
push:
branches: [ main ]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: write
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-14]
runs-on: ${{ matrix.os }}
steps:
# Step 1: Checkout the source repository
- name: Checkout code
uses: actions/checkout@v4
# Step 2: Install Fandango
- name: Install Fandango
uses: ./.github/workflows/setup-fandango
with:
python-version: "3.13"
needs-sudo: ${{ matrix.os == 'ubuntu-latest' }}
# Step 3: Build the documentation
- name: Build the book
shell: bash
run: |
if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then
sudo make system-dev-tools
else
make system-dev-tools
fi
make web
echo "Exit code: $?"
# Step 4: Upload built book as artifact
- name: Upload built book as artifact
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v4
with:
name: book-html
path: docs/_build/html/
deploy:
# Only deploy on pushes to the release branch
if: github.ref == 'refs/heads/main'
needs: build
runs-on: ubuntu-latest
steps:
# Step 1: Checkout the source repository
- name: Checkout code
uses: actions/checkout@v4
# Step 2: Download built book artifact
- name: Download built book artifact
uses: actions/download-artifact@v4
with:
name: book-html
path: htmlcov
# Step 3: Clone the target repository
- name: Clone the target repository
run: |
git clone https://github.com/fandango-fuzzer/fandango-fuzzer.github.io.git gh-pages
# Step 4: Copy the built HTML files to the target repository
- name: Copy built files to the target repository
run: |
cp -r htmlcov/* gh-pages/
# Step 5: Commit and push changes to the target repository
- name: Deploy to GitHub Pages
run: |
cd gh-pages
git config --global user.name "${{ secrets.CI_COMMIT_AUTHOR }}"
git config --global user.email "${{ secrets.CI_COMMIT_EMAIL }}"
git add .
git commit -m "Update GitHub Pages site" || echo "No changes to commit"
git push https://x-access-token:${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/fandango-fuzzer/fandango-fuzzer.github.io.git main