You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
83 lines
1.6 KiB
83 lines
1.6 KiB
7 months ago
|
name: GitHub Pages
|
||
|
|
||
|
on:
|
||
|
workflow_dispatch:
|
||
|
push:
|
||
|
branches:
|
||
|
- master
|
||
|
paths:
|
||
|
- docs/**
|
||
|
|
||
|
permissions:
|
||
|
contents: read
|
||
|
pages: write
|
||
|
id-token: write
|
||
|
|
||
|
concurrency:
|
||
|
group: pages
|
||
|
cancel-in-progress: false
|
||
|
|
||
|
jobs:
|
||
|
dispatch:
|
||
|
|
||
|
runs-on: ubuntu-latest
|
||
|
|
||
|
steps:
|
||
|
- name: Dispatch to gdl-org/docs
|
||
|
run: >
|
||
|
curl -L
|
||
|
-X POST
|
||
|
-H "Accept: application/vnd.github+json"
|
||
|
-H "Authorization: Bearer ${{ secrets.DISPATCH_TOKEN }}"
|
||
|
-H "X-GitHub-Api-Version: 2022-11-28"
|
||
|
https://api.github.com/repos/gdl-org/docs/actions/workflows/pages.yml/dispatches
|
||
|
-d '{"ref":"master"}'
|
||
|
|
||
|
build:
|
||
|
|
||
|
runs-on: ubuntu-latest
|
||
|
|
||
|
steps:
|
||
|
- uses: actions/checkout@v4
|
||
|
|
||
|
- uses: actions/configure-pages@v4
|
||
|
|
||
|
- uses: actions/setup-python@v5
|
||
|
with:
|
||
|
python-version: "3.12"
|
||
|
|
||
|
- name: Install Docutils
|
||
|
run: pip install docutils pygments
|
||
|
|
||
|
- name: Update Links
|
||
|
working-directory: ./docs/
|
||
|
run: sed --in-place 's/\.\(rst\|md\)\b/.html/g' -- *.md *.rst
|
||
|
|
||
|
- name: reStructuredText to HTML
|
||
|
working-directory: ./docs/
|
||
|
run: |
|
||
|
while read -r RST
|
||
|
do
|
||
|
python -m docutils --writer=html --output="${RST%.rst}.html" -- "$RST"
|
||
|
done < <(find . -type f -name "*.rst")
|
||
|
|
||
|
- uses: actions/jekyll-build-pages@v1
|
||
|
with:
|
||
|
source: ./docs/
|
||
|
destination: ./_site/
|
||
|
|
||
|
- uses: actions/upload-pages-artifact@v3
|
||
|
|
||
|
deploy:
|
||
|
|
||
|
runs-on: ubuntu-latest
|
||
|
|
||
|
needs: build
|
||
|
environment:
|
||
|
name: github-pages
|
||
|
url: ${{ steps.deployment.outputs.page_url }}
|
||
|
|
||
|
steps:
|
||
|
- uses: actions/deploy-pages@v4
|
||
|
id: deployment
|