-
Notifications
You must be signed in to change notification settings - Fork 6
53 lines (46 loc) · 1.32 KB
/
build.yml
File metadata and controls
53 lines (46 loc) · 1.32 KB
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
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@v4
- name: Setup bun
uses: oven-sh/setup-bun@v2
- name: Install dependencies
run: bun install --no-save
- name: Build
run: bun run ./build.js
- name: Commit artifacts
if: github.ref == 'refs/heads/master'
run: |
export APPVERSION=$(bun -e "console.log(require('./package.json').version)")
mv dist /tmp/app-dist
git tag -f "v$APPVERSION"
git push -f --tags
git fetch origin dist
git checkout -f dist
mv /tmp/app-dist/* ./
git add app*
git config user.name github-actions
git config user.email github-actions@github.com
git diff-index --quiet HEAD || git commit -m "v$APPVERSION"
git push
- name: Notify server
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