Convert jingkaimori doc to html for CICD #8
Workflow file for this run
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: CI/CD for Converting tm format to html | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
env: | |
XMAKE_ROOT: y | |
QT_QPA_PLATFORM: offscreen | |
INSTALL_DIR: tmp/build/packages/app.mogan/ | |
jobs: | |
build: | |
container: debian:bookworm | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: true | |
matrix: | |
include: | |
- qt_pkg: qt6-base-dev libqt6svg6-dev qt6-image-formats-plugins | |
qt_ver: 6 | |
steps: | |
- name: Install dependencies | |
run: | | |
DEBIAN_FRONTEND=noninteractive apt-get update | |
DEBIAN_FRONTEND=noninteractive apt-get install -y gcc git 7zip unzip curl build-essential \ | |
fonts-noto-cjk libcurl4-openssl-dev libfreetype-dev libfontconfig-dev \ | |
${{matrix.qt_pkg}} libgit2-dev zlib1g-dev libssl-dev libjpeg62-turbo-dev cmake \ | |
libmimalloc-dev | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: git add safe directory | |
run: git config --global --add safe.directory '*' | |
- name: Clone mogan research repository | |
run: git clone https://github.com/XmacsLabs/mogan.git | |
- name: Change to mogan directory | |
run: cd mogan | |
- name: set XMAKE_GLOBALDIR | |
run: echo "XMAKE_GLOBALDIR=${{ runner.workspace }}/xmake-global" >> $GITHUB_ENV | |
- uses: xmake-io/github-action-setup-xmake@v1 | |
with: | |
xmake-version: v2.8.7 | |
actions-cache-folder: '.xmake-cache' | |
- name: xmake repo --update | |
run: cd mogan && xmake repo --update | |
- name: cache packages from xrepo | |
uses: actions/cache@v3 | |
with: | |
path: | | |
${{ env.XMAKE_GLOBALDIR }}/.xmake/packages | |
key: ${{ runner.os }}-xrepo-qt${{ matrix.qt_ver }}-${{ hashFiles('**/packages.lua') }} | |
- name: cache xmake | |
uses: actions/cache@v3 | |
with: | |
path: | | |
tmp/build/.build_cache | |
key: ${{ runner.os }}-build-qt${{ matrix.qt_ver }}-${{ hashFiles('**/packages.lua') }} | |
- name: config | |
run: | | |
cd mogan | |
xmake config -vD --policies=build.ccache -o tmp/build -m releasedbg --yes | |
- name: build | |
run: | |
cd mogan | |
xmake build --yes -vD research && xmake build --yes -vD --group=tests | |
- name: convert document to html format | |
run: | |
cd mogan | |
xmake r tm2html_CICD | |
- name: Checkout gh-pages branch | |
uses: actions/checkout@v3 | |
with: | |
ref: gh-pages | |
persist-credentials: false # This ensures the credentials are not persisted to the subsequent steps | |
path: gh-pages # This checks out the gh-pages branch into a separate directory | |
- name: List root directory for debugging | |
run: | | |
ls -al | |
cd CICD | |
ls -al | |
cd html | |
ls -al | |
- name: Copy output files | |
run: | |
cp -r CICD/html/* gh-pages/ | |
- name: Commit and push changes | |
working-directory: gh-pages | |
run: | | |
git config --global user.name 'github-actions' | |
git config --global user.email '[email protected]' | |
git add . | |
git commit -m "Update HTML output" | |
git push origin gh-pages | |