-
Notifications
You must be signed in to change notification settings - Fork 5
52 lines (50 loc) · 1.42 KB
/
build.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
name: Build and deploy
on:
push:
branches-ignore:
- dist
paths:
- 'package.json'
pull_request:
branches-ignore:
- dist
paths:
- 'package.json'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
name: Build
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: 17
- name: Install dependencies
run: npm install --production
- name: Build
run: npm run-script build
- name: Commit artifacts
if: github.ref == 'refs/heads/master'
run: |
export APPVERSION=$(echo "console.log(require('./package.json').version)" | node)
mv dist /tmp/app-dist
git tag -f "v$APPVERSION"
git push -f --tags
git clean -f
rm -rf ./node_modules
git fetch
git checkout dist
mv /tmp/app-dist/* ./
git config user.name github-actions
git config user.email github-actions@github.com
git add .
git diff-index --quiet HEAD || git commit -m "v$APPVERSION"
git push
- name: Update commit reference
if: github.ref == 'refs/heads/master'
run: |
echo "::add-mask::${{ secrets.UPDATE_KEY }}"
curl -X POST -d "key=${{ secrets.UPDATE_KEY }}" https://l3p3.de/svr/minicraft/update.txt