2022-11-14 04:59:12 +03:00
|
|
|
name: docs
|
2022-11-14 05:39:36 +03:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
2022-11-14 04:59:12 +03:00
|
|
|
jobs:
|
2022-11-14 05:39:36 +03:00
|
|
|
publish-docs:
|
2022-11-14 04:59:12 +03:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout ntfy code
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
-
|
|
|
|
name: Checkout docs pages code
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
repository: binwiederhier/ntfy-docs.github.io
|
2022-11-14 05:05:03 +03:00
|
|
|
path: build/ntfy-docs.github.io
|
2022-11-14 05:33:27 +03:00
|
|
|
token: ${{secrets.NTFY_DOCS_PUSH_TOKEN}}
|
|
|
|
# Expires after 1 year, re-generate via
|
|
|
|
# User -> Settings -> Developer options -> Personal Access Tokens -> Fine Grained Token
|
2022-11-14 04:59:12 +03:00
|
|
|
-
|
|
|
|
name: Build docs
|
2022-11-14 05:23:25 +03:00
|
|
|
run: make docs
|
2022-11-14 05:05:03 +03:00
|
|
|
-
|
|
|
|
name: Copy generated docs
|
2022-11-14 05:23:25 +03:00
|
|
|
run: rsync -av --exclude CNAME --delete server/docs/ build/ntfy-docs.github.io/docs/
|
2022-11-14 04:59:12 +03:00
|
|
|
-
|
|
|
|
name: Publish docs
|
|
|
|
run: |
|
2022-11-14 05:05:03 +03:00
|
|
|
cd build/ntfy-docs.github.io
|
2022-11-14 04:59:12 +03:00
|
|
|
git config user.name "GitHub Actions Bot"
|
2023-05-23 21:50:20 +03:00
|
|
|
git config user.email "<actions@github.com>"
|
2022-11-14 04:59:12 +03:00
|
|
|
git add docs/
|
|
|
|
git commit -m "Updated docs"
|
|
|
|
git push origin main
|