-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (28 loc) · 947 Bytes
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Build and Deploy React Website
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '14' # Use the Node.js version that matches your development environment
- name: Install dependencies
run: npm install
- name: Build
run: npm run build
- name: Test # Optional, remove if you don't have tests
run: npm test
# Deployment step, adjust if using a host other than GitHub Pages
- name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build # Adjust this path to your build directory