-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (28 loc) · 839 Bytes
/
main.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
name: Deploy to GitHub pages
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Generate static React files
uses: actions/setup-node@v2
with:
node-version: '16'
- run: npm install
- run: npm run build
- name: Init new repo in build folder and commit generated files
run: |
cd build
git init
git add -A
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git commit -m 'deploy'
- name: Force push to gh-pages branch
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
force: true
directory: build