Skip to content

Deploy to Github Pages #35

Deploy to Github Pages

Deploy to Github Pages #35

Workflow file for this run

name: Deploy to Github Pages
on:
# Enable Manual deployments
# https://docs.github.com/en/actions/using-workflows/manually-running-a-workflow
workflow_dispatch:
# Required Permissions
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
permissions:
id-token: write # This is required for requesting the JWT
contents: write # This is required for actions/checkout
pages: write # Required for deployment
# Disable pages deployment concurrency
# https://docs.github.com/en/actions/using-jobs/using-concurrency
concurrency:
group: 'pages'
cancel-in-progress: false
jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-20.04
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: Install
run: npm ci
- name: Build and render
run: npm run predeploy
- name: Deploy to gh-pages branch
run: |
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
npx gh-pages -d build -u "github-actions-bot <[email protected]>"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: 'build'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2