Skip to content

Disable react-ga4 tracking on localhost #43

Disable react-ga4 tracking on localhost

Disable react-ga4 tracking on localhost #43

name: Build and Deploy to GitHub Pages
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up Node.js environment
uses: actions/setup-node@v6
with:
node-version: "latest"
- name: Update npm to latest version
run: npm install -g npm@latest
- name: Install dependencies
run: npm install
- name: Generate notes meta index
run: node scripts/generateNotesIndex.js
- name: Build website
run: |
export CI=false
npm run build
- name: Generate 404.html
run: cp ./dist/index.html ./dist/404.html
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
publish_branch: gh-pages