publish docs index and github pages workflow
This commit is contained in:
parent
276d48950d
commit
4bacf2c2f8
5 changed files with 1311 additions and 0 deletions
56
.github/workflows/docs-pages.yml
vendored
Normal file
56
.github/workflows/docs-pages.yml
vendored
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
name: Publish Docs
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- "docs/**"
|
||||
- "scripts/generate-docs-index.mjs"
|
||||
- ".github/workflows/docs-pages.yml"
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
pages: write
|
||||
id-token: write
|
||||
|
||||
concurrency:
|
||||
group: "pages"
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Configure Pages
|
||||
uses: actions/configure-pages@v5
|
||||
|
||||
- name: Build docs index
|
||||
run: node scripts/generate-docs-index.mjs
|
||||
|
||||
- name: Prepare static site payload
|
||||
run: |
|
||||
mkdir -p site/docs
|
||||
cp -R docs/. site/docs/
|
||||
printf '%s\n' '<!doctype html><meta charset="utf-8"><meta http-equiv="refresh" content="0; url=./docs/"><title>Islandflow Docs</title><a href="./docs/">Continue to docs</a>' > site/index.html
|
||||
touch site/.nojekyll
|
||||
|
||||
- name: Upload Pages artifact
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
with:
|
||||
path: site
|
||||
|
||||
deploy:
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Deploy to GitHub Pages
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v4
|
||||
Loading…
Add table
Add a link
Reference in a new issue