-
-
Notifications
You must be signed in to change notification settings - Fork 573
69 lines (59 loc) · 1.61 KB
/
release.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Release
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set up Repository
uses: actions/checkout@v2
with:
ref: master
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: 18
- name: Cache NPM Dependencies
id: cache-npm-dependencies
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node_modules-
- name: Install NPM Dependencies if not cached
if: steps.cache-npm-dependencies.outputs.cache-hit != 'true'
run: |
npm install
- name: Build Project
run: |
npm run build-prod
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: dist
path: dist
commit-build:
needs: build
runs-on: ubuntu-latest
steps:
- name: Set up Repository
uses: actions/checkout@v2
with:
ref: build
- name: Download Build
uses: actions/download-artifact@v2
with:
name: dist
path: dist
- name: Commit and Push
run: |
if [ $(git status dist --porcelain=v1 2>/dev/null | wc -l) != "0" ] ; then
git config user.name "GitHub Actions"
git config user.email [email protected]
git add dist
git commit -m "chore: updated build"
git push origin HEAD --force
fi