forked from goonstation/goonstation
-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (47 loc) · 1.72 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
name: Rebuild TGUI
on:
repository_dispatch:
types: [rebuild-tgui]
# Config
env:
COMMIT_NAME: 'Actions (TGUI Rebuild)'
COMMIT_EMAIL: '[email protected]'
DEFAULT_BRANCH: 'master'
TOKEN: '${{ secrets.GITHUB_TOKEN }}'
jobs:
rebuild:
name: 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.
# Changed tgui/public to browserassets/tgui for goonstation.
- 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 -s ours --no-commit base/${{ env.DEFAULT_BRANCH }}
git checkout base/${{ env.DEFAULT_BRANCH }} browserassets/tgui
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