Skip to content

disable autosubscript #43

disable autosubscript

disable autosubscript #43

name: Deploy React to gh-pages with staging branch
on:
push:
branches: ['main', 'rewrite']
workflow_dispatch:
jobs:
build-main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: main
- uses: actions/setup-node@v3
with:
cache: 'npm'
- run: npm ci
- name: Build app
run: PUBLIC_URL=https://JosiahFu.github.io/math-notes npm run build
- uses: actions/upload-artifact@v3
with:
path: build/*
name: build-main
build-staging:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: rewrite
- uses: actions/setup-node@v3
with:
cache: 'npm'
- run: npm ci
- name: Build app
run: npm run build
- uses: actions/upload-artifact@v3
with:
path: dist/*
name: build-staging
assemble:
runs-on: ubuntu-latest
needs: [build-main, build-staging]
steps:
- name: Download main build
uses: actions/download-artifact@v3
with:
name: build-main
path: build
- name: Download staging build
uses: actions/download-artifact@v3
with:
name: build-staging
path: build/staging
- name: Upload GitHub Pages artifact
uses: actions/[email protected]
with:
# Path of the directory containing the static assets.
path: build
deploy:
runs-on: ubuntu-latest
needs: assemble
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1