### Changes:
- **deploy-demo.yml**:
- Added `contents: write` permissions to ensure the workflow can access repository content during operations.
- Used `${{ secrets.GITHUB_TOKEN }}` for authentication in the deployment step.
- **package.json**:
- Removed the `deploy:demo` script and its `gh-pages` dependency to clean up unused scripts and dependencies.
### Purpose:
Enhanced the deploy workflow by explicitly defining required permissions and securely managing authentication. Simplified the configuration by removing outdated scripts and dependencies.
36 lines
799 B
YAML
36 lines
799 B
YAML
name: Deploy Demo to GitHub Pages
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-and-deploy:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- name: Checkout 🛎️
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Setup Node.js 🔧
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: '23'
|
|
cache: 'npm'
|
|
|
|
- name: Install dependencies 📦
|
|
run: npm install --legacy-peer-deps
|
|
|
|
- name: Build project 🏗️
|
|
run: |
|
|
npm run build
|
|
npm run build:browser
|
|
|
|
- name: Deploy to GitHub Pages 🚀
|
|
uses: JamesIves/github-pages-deploy-action@v4
|
|
with:
|
|
folder: examples
|
|
branch: gh-pages
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|