fix(Lib): string.Template.substitute(dict) not work #183
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: docs | |
# yamllint disable-line rule:truthy | |
on: | |
push: | |
branches: | |
- master | |
env: | |
nim-version: 'stable' | |
git-url-arg: --git.url:https://github.com/${{ github.repository }} --git.commit:master | |
deploy-dir: .gh-pages | |
lib-deploy-dir: .gh-pages/Lib | |
jobs: | |
docs: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache nimble | |
id: cache-nimble | |
uses: actions/cache@v4 | |
with: | |
path: ~/.nimble | |
key: ${{ runner.os }}-nimble | |
- uses: jiro4989/setup-nim-action@v1 | |
with: | |
nim-version: ${{ env.nim-version }} | |
- name: genDoc | |
run: nimble testDoc --index:on --project ${{ env.git-url-arg }} --outdir:${{ env.deploy-dir }} -d:homepage="${{ github.event.repository.homepage }}" | |
- name: genLibDoc | |
run: nimble testLibDoc ${{ env.git-url-arg }} --outdir:${{ env.lib-deploy-dir }} | |
- name: "Copy to index.html" | |
run: cp ${{ env.deploy-dir }}/${{ github.event.repository.name }}.html ${{ env.deploy-dir }}/index.html | |
- name: "CNAME" | |
run: | | |
cname=$(echo ${{ github.event.repository.homepage }} | grep -oP 'https?://\K[^/]+') | |
prefix="docs." | |
# py: if cname.startswith(prefix) | |
# bash: if [[ "${cname}" != $prefix* ]] | |
if [ ${cname##$prefix} = $cname ]; then | |
cname="${prefix}${cname}" | |
fi | |
echo -n $cname > ${{ env.deploy-dir }}/CNAME | |
# We must re-build CNAME as we use 'peaceiris/actions-gh-pages@v4', | |
# where the old dir (including CNAME) will be purged. | |
- name: Deploy documents | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ${{ env.deploy-dir }} |