Skip to content

cd-stage

cd-stage #342

Workflow file for this run

name: cd-stage
on:
workflow_dispatch:
# inputs:
# build_pdf:
# description: 'build pdf book? (it is increase time workflow)'
# required: true
# default: 'no'
# type: choice
# options:
# - 'yes'
# - 'no'
push:
branches:
- 'dependabot/**'
env:
PUBLISH_BRANCH: web-page-stage
jobs:
generate-plantuml-diagrams:
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- name: checkout to build branch
uses: actions/checkout@v4
- name: generate `**.svg` for `**.plantuml`
uses: holowinski/plantuml-github-action@main
with:
args: -v -tsvg **.plantuml
- name: push diagrams to runing branch
uses: EndBug/[email protected]
with:
message: auto-generate `**.svg` for `**.plantuml`
create-folder-for-latex:
runs-on: ubuntu-latest
timeout-minutes: 1
steps:
- name: checkout to build branch
uses: actions/checkout@v4
with:
ref: ${{ env.PUBLISH_BRANCH }}
- name: create `./latex/`
run: |
mkdir -p ./latex/
build-and-deploy-book:
needs: [generate-plantuml-diagrams, create-folder-for-latex]
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: write
environment:
name: qmlc-web-page-stage
url: https://qmlc-web-page-stage.netlify.app
steps:
- name: checkout to build branch
uses: actions/checkout@v4
- name: set up poetry
uses: snok/install-poetry@v1
with:
version: 1.3.2
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: set up python
uses: actions/setup-python@v5
with:
python-version: 3.8
cache: 'poetry'
- name: install dependencies
run: |
poetry install --no-interaction --no-root
- name: build the book
id: build_book
env:
DWAVE_TOKEN: ${{ secrets.DWAVE_TOKEN }}
run: |
poetry run jupyter-book toc migrate ./qmlcourse/_toc.yml -o ./qmlcourse/_toc.yml
poetry run jupyter-book build ./qmlcourse
- name: update publish dir to build branch
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./qmlcourse/_build/html/
publish_branch: ${{ env.PUBLISH_BRANCH }}
exclude_assets: './qmlcourse/_static/*'
# - name: build latex files
# if: github.event.inputs.build_pdf == 'yes'
# env:
# DWAVE_TOKEN: ${{ secrets.DWAVE_TOKEN }}
# run: |
# sudo apt-get install texlive-latex-extra texlive-fonts-extra texlive-xetex latexmk
# poetry run jupyter-book build ./qmlcourse --builder latex
# - name: create pdf book
# if: github.event.inputs.build_pdf == 'yes'
# continue-on-error: true
# run: |
# cd ./qmlcourse/_build/latex/
# xelatex -interaction=nonstopmode qmlcourse.tex
# - name: send pdf book to build branch
# if: github.event.inputs.build_pdf == 'yes'
# uses: peaceiris/[email protected]
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# publish_dir: ./qmlcourse/_build/latex/
# destination_dir: ./latex/
# publish_branch: ${{ env.PUBLISH_BRANCH }}