-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (47 loc) · 1.16 KB
/
build-prod.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
name: Build Production
on:
push:
branches:
- main
jobs:
build:
name: Build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 'latest'
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.DISPATCH_WORKFLOW }}
- name: Webpack
run: |
npm install
NODE_ENV=production webpack --mode production
- name: Prune Files
run : |
prune() {
echo "Remove: ${1}"
if
[ "${1}" != "." ] &&
[ "${1}" != ".." ] &&
[ "${1}" != "./.git" ] &&
[ "${1}" != "./docs" ] &&
[ "${1}" != "./LICENSE" ] &&
[ "${1}" != "./README.md" ]; then
rm -rf ${1}
fi
}
export -f prune
find . -maxdepth 1 | while read file; do prune ${file}; done
- name: Push Client
run: |
git config user.name "chiefmikey"
git config user.email "wolfemikl@gmail.com"
git add .
git commit -am 'Update production build'
git push -fu origin HEAD:client