Skip to content

website/package.json update #107

website/package.json update

website/package.json update #107

# 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