github: add workflow_dispatch to gh-pages #88
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: gh-pages | |
on: | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
jobs: | |
gh-pages: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup Git configs | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git config user.name "${GITHUB_ACTOR}" | |
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" | |
- name: Convert asciidoc to markdown | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y --no-install-recommends --no-install-suggests pandoc ruby-dev | |
sudo gem install asciidoctor --pre | |
asciidoctor -b docbook -a leveloffset=+1 -o - WebAssembly.asciidoc | pandoc --atx-headers --wrap=preserve -t markdown_strict -f docbook - > WebAssembly.md | |
- name: Build and deploy with mkdocs | |
uses: docker://squidfunk/mkdocs-material:latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
entrypoint: sh | |
args: | | |
-c \ | |
"git config --global --add safe.directory /github/workspace && \ | |
pip install -U --pre --compile --requirement /github/workspace/config/requirements.txt && \ | |
mkdocs build -c -f /github/workspace/config/mkdocs.yml && \ | |
mkdocs gh-deploy --config-file /github/workspace/config/mkdocs.yml --verbose --force" |