File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Build & Deploy React App
2+
3+ on :
4+ push :
5+ branches : [ master ]
6+ pull_request :
7+ branches : [ master ]
8+
9+ jobs :
10+ build :
11+ runs-on : ubuntu-latest
12+ steps :
13+ - uses : actions/checkout@v2
14+ - name : Use Node.js 16.x
15+ uses : actions/setup-node@v2
16+ with :
17+ node-version : ' 16.x'
18+ cache : ' npm'
19+ - name : Install npm packages
20+ run : npm ci
21+ - name : Build React App
22+ run : npm run build --if-present
23+ - name : Run Tests
24+ run : npm test
25+ - name : Deploy to GitHub Pages
26+ run : |
27+ git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
28+ npm run deploy -u "github-actions-bot <[email protected] >" 29+ if : ${{ github.ref == 'refs/heads/master' }} # only deploy master
30+ env :
31+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments