Merge pull request #60 from MtFmT-Lib/test_and_doc #149
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Document | |
on: | |
push: | |
paths: | |
- "src/**.c" | |
- "inc/**.h" | |
- "inc/**.hpp" | |
- ".github/workflows/document.yml" | |
- "www/**.ts" | |
- "www/**.js" | |
- "www/**.md" | |
- "www/**.svg" | |
- "www/**.html" | |
- "www/**.scss" | |
- "www/**.svelte" | |
- "www/wasm/**" | |
pull_request: | |
branches: [master] | |
paths: | |
- "src/**.c" | |
- "inc/**.h" | |
- "inc/**.hpp" | |
- ".github/workflows/document.yml" | |
- "www/**.ts" | |
- "www/**.js" | |
- "www/**.md" | |
- "www/**.svg" | |
- "www/**.html" | |
- "www/**.scss" | |
- "www/**.svelte" | |
- "www/wasm/**" | |
workflow_dispatch: | |
inputs: | |
logLevel: | |
description: "Log level" | |
required: true | |
default: "warning" | |
# 保证权限合适 | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
# 避免跳过部署 | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
jobs: | |
# Build github pages | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
# Doxygen 样式 | |
- name: Doxygen scss compile | |
uses: gha-utilities/sass-build@v0.5.1 | |
with: | |
source: "./www/src/themes/doxygen/css/style.scss" | |
destination: "./www/src/themes/doxygen/html/style.css" | |
includePaths: "./www/src/themes/doxygen/:./www/src/themes/common/" | |
outputStyle: compressed | |
# Doxygen | |
- name: Doxygen | |
uses: mattnotmitt/doxygen-action@v1.9.5 | |
with: | |
working-directory: "./" | |
doxyfile-path: "Doxyfile" | |
# WASM | |
- name: Setup emsdk | |
uses: mymindstorm/setup-emsdk@v12 | |
- name: WASM build | |
working-directory: "./www/wasm" | |
run: | | |
emmake make | |
# 网页 | |
- name: Yarn | |
working-directory: "./www" | |
run: | | |
yarn install | |
yarn build | |
# 移除node module | |
- name: Remove node module | |
run: | | |
rm -rf www/node_modules | |
# 把文件移动到_site | |
- name: Move outputs | |
run: | | |
mkdir _site | |
mv www/dist/* _site | |
# 打包 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v1 | |
# 进行部署 (仅master branch) | |
deploy: | |
if: github.ref == 'refs/heads/master' | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: [build] | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 |