-
Notifications
You must be signed in to change notification settings - Fork 9
59 lines (55 loc) · 1.56 KB
/
client.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
name: Build and Deploy Client
on:
push:
branches:
- trunk
tags:
- "*"
env:
TARGET_CNAME: gameclient.dreamlab.gg
TARGET_REPO: WorldQL/dreamlab-gameclient-deploy
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: dreamlab
- name: Setup deno
uses: denoland/setup-deno@v2
with:
deno-version: v2.x
- name: Build client
working-directory: ./dreamlab/client
run: deno task build
env:
IS_DEV: "true"
- name: Upload build
uses: actions/upload-artifact@v4
if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
with:
name: client
path: ./dreamlab/client/web
retention-days: 14
- name: Checkout deployment repo
uses: actions/checkout@v4
if: ${{ startsWith(github.ref, 'refs/tags/') }}
with:
repository: ${{ env.TARGET_REPO }}
path: deploy
token: ${{ secrets.REPO_PAT }}
- name: Deploy
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: |
cd deploy
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git rm -r *
cp -RL ../dreamlab/client/web/. .
echo "${{ env.TARGET_CNAME }}" > CNAME
git add --all
git commit -m "generated from ${{ github.repository }}@${{ github.sha }}" || exit 0
git push