forked from BeeStation/BeeStation-Hornet
-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (79 loc) · 2.63 KB
/
tgui_recompile.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Rebuild TGUI
on:
repository_dispatch:
types: [rebuild-tgui]
push:
branches:
- 'master'
paths:
- 'tgui/**.js'
- 'tgui/**.scss'
# Config
env:
COMMIT_NAME: 'ss13-beebot'
COMMIT_EMAIL: '[email protected]'
DEFAULT_BRANCH: 'master'
TOKEN: '${{ secrets.CL_TOKEN }}'
jobs:
ondemand_rebuild:
if: ${{ github.event_name == 'repository_dispatch' }}
name: On-Demand Rebuild
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
repository: ${{ github.event.client_payload.pr_head_full_repo_name }}
ref: ${{ github.event.client_payload.pr_head_ref }}
token: ${{ env.TOKEN }}
- name: Setup Author
run: |
git config --local user.email "${{ env.COMMIT_EMAIL }}"
git config --local user.name "${{ env.COMMIT_NAME }}"
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: '>=12.13'
# This only runs if the PR has a merge conflict. Serves to attempt resolving merge conflicts rather than just rebuilding.
# Uses a smart little git hack to make a merge commit for just a limited set of files.
- name: Conflict Resolution
if: ${{ github.event.client_payload.mergeable == false }}
run: |
git remote add base https://github.com/${{ github.repository }}.git
git fetch base ${{ env.DEFAULT_BRANCH }}
git merge --squash -s ours --no-commit base/${{ env.DEFAULT_BRANCH }}
git checkout HEAD .
git clean -fxd
git checkout base/${{ env.DEFAULT_BRANCH }} tgui/public
git commit -m "TGUI Reset" -a || true
- name: Build TGUI
run: bin/tgui
working-directory: ./tgui
- name: Commit and Push Build
run: |
git commit -m "TGUI Rebuild" -a || true
git push
auto_rebuild:
if: ${{ github.event_name == 'push' }}
name: Automatic Rebuild
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 25
token: ${{ env.TOKEN }}
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: '>=12.13'
- name: Build TGUI
run: bin/tgui
working-directory: ./tgui
- name: Commit and Push Build
run: |
git config --local user.email "${{ env.COMMIT_EMAIL }}"
git config --local user.name "${{ env.COMMIT_NAME }}"
git pull origin master
git commit -m "Automatic TGUI Rebuild [ci skip]" -a || true
git push