Skip to content

Instantly share code, notes, and snippets.

@sadiqsalau
Last active April 26, 2023 03:48
Show Gist options
  • Save sadiqsalau/179544b6e9d0114a319026e64429b584 to your computer and use it in GitHub Desktop.
Save sadiqsalau/179544b6e9d0114a319026e64429b584 to your computer and use it in GitHub Desktop.
React App Build Workflow
name: "Build and Deploy"
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [node]
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: latest
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"
- name: Install dependencies
run: pnpm install
- name: Build
run: pnpm run build
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment