28 lines
897 B
YAML
28 lines
897 B
YAML
name: Deploy to GitHub Pages
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main # Or your default branch
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write # Allows gh-pages to push to the gh-pages branch
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20' # Or your preferred Node.js version
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Deploy to GitHub Pages
|
|
run: npx gh-pages -d dist --repo "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git" --user "GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com>"
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Ensures token is available if gh-pages or git commands need it directly |