Skip to content

Commit 35f0599

Browse files
faster deployments
unnecessary steps removed
1 parent c105809 commit 35f0599

File tree

1 file changed

+10
-43
lines changed

1 file changed

+10
-43
lines changed

.github/workflows/deploy.yml

Lines changed: 10 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,28 @@
1-
name: Build
1+
name: Build & Deploy
22

33
on:
44
push:
5-
branches:
6-
- master
7-
pull_request:
8-
branches:
9-
- master
5+
branches: [master]
106
workflow_dispatch:
117

128
jobs:
13-
build:
14-
name: Build
9+
Build-Deploy:
1510
runs-on: ubuntu-latest
1611

1712
steps:
1813
- name: Checkout code
19-
uses: actions/checkout@v2
14+
uses: actions/checkout@v3
2015

2116
- name: Set up Node.js
22-
uses: actions/setup-node@v1
17+
uses: actions/setup-node@v3
2318
with:
2419
node-version: '16.6.1'
20+
cache: npm
2521

26-
- name: Cache Node.js modules
27-
uses: actions/cache@v2
28-
with:
29-
path: ~/.npm
30-
key: ${{ runner.OS }}-noder-${{ hashFiles('**/package-lock.json') }}
31-
restore-keys: |
32-
${{ runner.OS }}-node-
33-
${{ runner.OS }}-
34-
35-
- name: Install dependencies
36-
run: CI=false npm install
37-
38-
- name: Build project
39-
run: CI=false npm run build
40-
41-
- name: Upload production-ready build files
42-
uses: actions/upload-artifact@v2
43-
with:
44-
name: production-files
45-
path: ./build
46-
47-
deploy:
48-
name: Deploy
49-
needs: build
50-
runs-on: ubuntu-latest
51-
if: github.ref == 'refs/heads/master'
52-
53-
steps:
54-
- name: Download artifact
55-
uses: actions/download-artifact@v2
56-
with:
57-
name: production-files
58-
path: ./build
22+
- name: Build
23+
run: |
24+
CI=false npm install
25+
CI=false npm run build
5926
6027
- name: Deploy to gh-pages
6128
uses: peaceiris/actions-gh-pages@v3

0 commit comments

Comments
 (0)