Build document #2
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: Build document | |
on: [ push, create ] | |
jobs: | |
make-document: | |
name: Compile document | |
runs-on: ubuntu-latest | |
container: | |
image: k4zuki/pandocker-alpine:2.19 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup safe directory for git | |
run: | | |
repo=${GITHUB_REPOSITORY#${GITHUB_REPOSITORY_OWNER}/} | |
git config --global --add safe.directory /__w/${repo}/${repo} | |
- name: Update dependencies | |
run: | | |
pip3 install pandocker-lua-filters | |
pip3 install -U docx-coreprop-writer | |
pip3 install git+https://github.com/k4zuki/[email protected] | |
- name: Set env | |
run: | | |
- name: Prepare QR code for this build (at a tag) | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
run: | | |
pip3 install qrcode | |
make initdir html | |
RELEASE_VERSION=${GITHUB_REF#refs/*/} | |
DOWNLOAD_URL_BASE=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/releases/download | |
TARGET=`ls doc/Out/*.html` | |
TARGET=${TARGET#doc/Out/} | |
qr ${DOWNLOAD_URL_BASE}/${RELEASE_VERSION}/${TARGET//.html/}.pdf > doc/images/QRcode.png | |
- name: Build document | |
run: | | |
make initdir html docx pdf apidoc | |
- name: Upload artifact files (at a push) | |
uses: actions/upload-artifact@v3 | |
with: | |
path: | | |
doc/Out | |
micropython/doc/Out |