Skip to content

Deploy profile site to GitHub Pages #105

Deploy profile site to GitHub Pages

Deploy profile site to GitHub Pages #105

Workflow file for this run

name: Deploy profile site to GitHub Pages
on:
push:
branches:
- web
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 repository
uses: actions/checkout@v4
with:
ref: web
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
run_install: false
- name: Install dependencies
run: pnpm install
- name: Build site
env:
# Optional: use GitHub Actions token for higher rate limits
# and to include private repos in stats if desired.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Default to this repo's owner as the GitHub profile target.
GITHUB_OWNER: ${{ github.repository_owner }}
GITHUB_PROFILE_TYPE: user
# Set Vite base path for GitHub Pages
VITE_BASE: ${{ endsWith(github.event.repository.name, '.github.io') && '/' || format('/{0}/', github.event.repository.name) }}
# Admin panel (route /admin) – set in repo Settings → Secrets and variables → Actions
# VITE_GITHUB_CLIENT_ID from secret (create OAuth App at github.com/settings/developers)
VITE_GITHUB_CLIENT_ID: ${{ secrets.VITE_GITHUB_CLIENT_ID }}
VITE_GITHUB_OWNER: ${{ github.repository_owner }}
VITE_GITHUB_REPO: ${{ github.event.repository.name }}
# OAuth CORS proxy – optional; add repo variable for admin login in production
VITE_GITHUB_OAUTH_PROXY_URL: ${{ vars.VITE_GITHUB_OAUTH_PROXY_URL }}
VITE_DATA_BRANCH: web
run: pnpm build
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: dist
deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4