Skip to content

Deploy to GitHub Pages #7652

Deploy to GitHub Pages

Deploy to GitHub Pages #7652

Workflow file for this run

name: Deploy to GitHub Pages
on:
workflow_run:
workflows: ["Update JSON from BoardCaster"]
types:
- completed
push:
branches:
- main # 或者你的默认分支名称
workflow_dispatch:
jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '16'
- name: Install dependencies
run: npm install
- name: Build project
run: npm run build
- name: Configure Git
run: |
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'
- name: Deploy to GitHub Pages
run: |
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
npm run deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}