.github/workflows/docs.yml
name: build-docs
on:
push:
tags:
- 'v*'
jobs:
build-docs:
name: build-docs
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: gh-pages
fetch-depth: 0
- name: Build docs.yml
uses: sudo-bot/action-doctum@v5
with:
config-file: doctum.dist.php
method: "update"
cli-args: "--output-format=github --no-ansi --no-progress --ignore-parse-errors -v"
- name: Build docs index file
uses: DamianReeves/write-file-action@master
with:
path: docs/index.html
write-mode: "overwrite"
contents: |
<!doctype HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="0; url=${{ github.ref_name }}/index.html">
<script type="text/javascript">
window.location.href = "${{ github.ref_name }}/index.html"
</script>
<title>docs Redirect</title>
</head>
<body>
If you are not redirected automatically, follow this <a href='${{ github.ref_name }}/index.html'>link to the docs page</a>.
</body>
</html>
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
- name: Checkout code to gh-pages
uses: actions/checkout@v4
with:
ref: gh-pages
fetch-depth: 0
clean: false
- name: Commit doc changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "chore: Publish docs"
file_pattern: "docs/*"
add_options: "-f"
skip_dirty_check: true
commit_user_name: brandon14
commit_user_email: brandon14125@gmail.com
commit_options: '-S'