Skip to content

Commit

Permalink
build(deploy): Deploy to static branch.
Browse files Browse the repository at this point in the history
  • Loading branch information
ZL-Asica committed Oct 7, 2024
1 parent 446d308 commit 70799e9
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Deploy React + Vite App

on:
push:
branches:
- master
- main

permissions:
contents: write

jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
# Use lts version of node
node-version: 'lts/*'
- name: Cache dependencies 📦
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies with npm
run: npm install
- name: Vite build 🏗️
run: npm run build
- name: Deploy to static branch 🚀
if: github.event_name != 'pull_request'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
# Do not keep files from the previous run
keep_files: false
# Deploy to the static branch
publish_branch: static

0 comments on commit 70799e9

Please sign in to comment.