|
1 | 1 | name: github pages |
2 | 2 |
|
3 | 3 | on: |
4 | | - workflow_dispatch: |
5 | | - push: |
6 | | - branches: |
7 | | - - master |
| 4 | + push: {} |
| 5 | + pull_request: {} |
| 6 | + workflow_dispatch: {} |
| 7 | + |
| 8 | +env: |
| 9 | + DEBIAN_FRONTEND: noninteractive |
| 10 | + TZ: Japan |
8 | 11 |
|
9 | 12 | jobs: |
10 | | - build: |
| 13 | + build-docs: |
11 | 14 | runs-on: ubuntu-latest |
| 15 | + timeout-minutes: 20 |
| 16 | + container: |
| 17 | + image: ubuntu:20.04 |
| 18 | + options: "--user 0" |
12 | 19 |
|
13 | 20 | steps: |
14 | | - - uses: actions/checkout@v4 |
| 21 | + - name: Set up base environment |
| 22 | + run: apt-get -y update && apt-get -y -o Dpkg::Options::='--force-confdef' -o Dpkg::Options::='--force-confold' install build-essential git doxygen graphviz p7zip-full |
| 23 | + |
| 24 | + - name: Checkout repository |
| 25 | + uses: actions/checkout@v4 |
| 26 | + |
| 27 | + - name: Mark all git directories safe |
| 28 | + run: git config --global --add safe.directory '*' |
15 | 29 |
|
16 | | - - name: clone custom doxygen CSS |
| 30 | + - name: Build documentation |
17 | 31 | run: | |
18 | | - git clone https://github.com/jothepro/doxygen-awesome-css |
| 32 | + export PS2DEV=$PWD/ps2dev |
| 33 | + export PS2SDK=$PS2DEV/ps2sdk |
| 34 | + make -j $(getconf _NPROCESSORS_ONLN) ONLY_HOST_TOOLS=1 docs |
| 35 | +
|
| 36 | + - name: Upload artifact |
| 37 | + uses: actions/upload-artifact@v4 |
| 38 | + with: |
| 39 | + name: ${{ github.event.repository.name }}-docs |
| 40 | + path: ./*.tgz |
19 | 41 |
|
20 | | - - name: Doxygen documentation generation |
21 | | - uses: mattnotmitt/doxygen-action@v1 |
| 42 | + publish-github-pages: |
| 43 | + needs: [build-docs] |
| 44 | + runs-on: ubuntu-latest |
| 45 | + timeout-minutes: 20 |
| 46 | + |
| 47 | + steps: |
| 48 | + - name: Download all artifacts |
| 49 | + uses: actions/download-artifact@v4 |
| 50 | + |
| 51 | + - name: Extract artifact |
| 52 | + run: | |
| 53 | + mkdir -p docs/html |
| 54 | + tar -xpzf */*.tgz -C docs/html |
22 | 55 |
|
23 | 56 | - name: Deploy |
| 57 | + if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' |
24 | 58 | uses: peaceiris/actions-gh-pages@v3 |
25 | 59 | with: |
26 | 60 | github_token: ${{ secrets.GITHUB_TOKEN }} |
|
0 commit comments