fix docs pages workflow for gh-pages branch deploy
Some checks are pending
Discord notifications / Push -> Discord (main) (push) Waiting to run
Discord notifications / CI result -> Discord (red on failure) (push) Waiting to run
Discord notifications / Release -> Discord (lavender) (push) Waiting to run
Publish Docs / publish (push) Waiting to run
Some checks are pending
Discord notifications / Push -> Discord (main) (push) Waiting to run
Discord notifications / CI result -> Discord (red on failure) (push) Waiting to run
Discord notifications / Release -> Discord (lavender) (push) Waiting to run
Publish Docs / publish (push) Waiting to run
This commit is contained in:
parent
3d31469867
commit
aae3fa1f19
2 changed files with 22 additions and 23 deletions
44
.github/workflows/docs-pages.yml
vendored
44
.github/workflows/docs-pages.yml
vendored
|
|
@ -11,23 +11,18 @@ on:
|
|||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
pages: write
|
||||
id-token: write
|
||||
contents: write
|
||||
|
||||
concurrency:
|
||||
group: "pages"
|
||||
group: "docs-pages"
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Configure Pages
|
||||
uses: actions/configure-pages@v5
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Build docs index
|
||||
run: node scripts/generate-docs-index.mjs
|
||||
|
|
@ -39,18 +34,21 @@ jobs:
|
|||
printf '%s\n' '<!doctype html><meta charset="utf-8"><meta http-equiv="refresh" content="0; url=https://dirtydishes.github.io/islandflow/docs/"><title>Islandflow Docs</title><a href="https://dirtydishes.github.io/islandflow/docs/">Continue to docs</a>' > site/index.html
|
||||
touch site/.nojekyll
|
||||
|
||||
- name: Upload Pages artifact
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
with:
|
||||
path: site
|
||||
- name: Publish to gh-pages branch
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
rm -rf .gh-pages-tmp
|
||||
mkdir .gh-pages-tmp
|
||||
cp -R site/. .gh-pages-tmp/
|
||||
cd .gh-pages-tmp
|
||||
|
||||
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
|
||||
git init
|
||||
git checkout -b gh-pages
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
git add -A
|
||||
git commit -m "publish docs from ${GITHUB_SHA}"
|
||||
|
||||
git push --force "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" gh-pages:gh-pages
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue