Skip to content

Restore GH_TOKEN in deploy workflow for gh-pages authentication + tes… #3

Restore GH_TOKEN in deploy workflow for gh-pages authentication + tes…

Restore GH_TOKEN in deploy workflow for gh-pages authentication + tes… #3

Workflow file for this run

name: Deploy to GitHub Pages
on:
push:
branches: [main, ci/github-actions] # runs after a PR is merged to main
permissions:
contents: write # needed to push to gh-pages
concurrency:
group: gh-pages-deploy
cancel-in-progress: false
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # gh-pages sometimes needs history
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
- name: Install deps
run: npm ci
- name: Build
run: npm run build
# retrieved from https://github.com/orgs/community/discussions/26560
- name: Git identity (use bot)
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
- name: Deploy (gh-pages)
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm run deploy