-
Notifications
You must be signed in to change notification settings - Fork 1
124 lines (100 loc) · 3.68 KB
/
publish-github-pages.yml
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# Simple workflow for deploying static content to GitHub Pages
name: GitHub Pages
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
# https://github.com/micro-os-plus/utils-lists-xpack/actions/workflows/publish-github-pages.yml
# https://micro-os-plus.github.io/utils-lists-xpack/
# TODO: remove xpack-develop
on:
# Runs on pushes, if all conditions are met:
push:
# ... on the master branch ...
branches:
- 'xpack'
- 'xpack-develop'
# ... skip tags only ...
tags-ignore:
- '**'
# ... any of these files changes ...
paths:
- 'website/**'
- 'src/**'
- 'include/**'
- '.github/workflows/publish-github-pages.yml'
# Allow one concurrent deployment
# https://docs.github.com/en/actions/using-jobs/using-concurrency
concurrency:
group: "pages"
cancel-in-progress: true
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
name: Build the Doxygen pages
strategy:
matrix:
# https://www.npmjs.com/package/xpm
xpm-version: [ '0.18.0' ]
# https://nodejs.org/en - use LTS
node-version: [ '18' ]
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
runs-on: ubuntu-22.04
steps:
- name: Checkout
# https://github.com/actions/checkout
uses: actions/checkout@v4
with:
fetch-depth: 3
- name: Use Node.js
# https://github.com/actions/setup-node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install Doxygen
# https://www.doxygen.nl/download.html
env:
DOXYGEN_VERSION: "1.9.8"
run: |
curl https://www.doxygen.nl/files/doxygen-$DOXYGEN_VERSION.linux.bin.tar.gz --output doxygen-$DOXYGEN_VERSION.linux.bin.tar.gz
tar xf doxygen-$DOXYGEN_VERSION.linux.bin.tar.gz
ls -l doxygen-$DOXYGEN_VERSION
mkdir -pv website/.local/bin
ln -sv $(pwd)/doxygen-$DOXYGEN_VERSION/bin/doxygen website/.local/bin/doxygen
ls -l website
- name: Install xpm@${{ matrix.xpm-version }}
run: |
npm install -g xpm@${{ matrix.xpm-version }}
- name: Install dependencies
# For the build helper and the Doxygen theme.
run: |
xpm install -C website
- name: Build site with Doxygen
run: (cd website; .local/bin/doxygen config.doxyfile)
- name: Configure Pages
# https://github.com/actions/configure-pages
uses: actions/configure-pages@v3
- name: Upload Pages artifact
# https://github.com/actions/upload-pages-artifact
uses: actions/upload-pages-artifact@v1
with:
# Upload entire repository
path: './website/html'
deploy:
name: Deploy to GitHub Pages
needs: build
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
runs-on: ubuntu-22.04
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment # referred by environment above, to get the URL.
# https://github.com/actions/deploy-pages
uses: actions/deploy-pages@v2
with:
artifact_name: github-pages
# Branch "xpack-develop" is not allowed to deploy to github-pages due to environment protection rules.
# https://github.com/micro-os-plus/micro-test-plus-xpack/settings/environments/1692678824/edit