-
-
Notifications
You must be signed in to change notification settings - Fork 57
134 lines (115 loc) · 4.16 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
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: Client CI/CD
on:
push:
branches:
- "main"
paths:
- "client/**"
- "common/**"
pull_request:
branches:
- "main"
paths:
- "server/**"
- "common/**"
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: pnpm/action-setup@v4
with:
version: 8.15.6
- uses: actions/setup-node@v3
with:
node-version: 20
cache: pnpm
- name: Install dependencies
run: pnpm --filter tachi-client... --filter . install
- name: Lint
run: pnpm --filter tachi-client lint
- name: Typecheck
run: pnpm --filter tachi-client typecheck
deploy:
runs-on: [ubuntu-latest]
needs: test
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: pnpm/action-setup@v4
with:
version: 8.15.6
- uses: actions/setup-node@v3
with:
node-version: 20
cache: pnpm
- name: Enable SSH Key
run: |
mkdir -p ~/.ssh
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
sudo chmod 600 ~/.ssh/id_rsa
echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
env:
SSH_PRIVATE_KEY: ${{secrets.SSH_PRIVATE_KEY}}
SSH_KNOWN_HOSTS: ${{secrets.SSH_KNOWN_HOSTS}}
- name: Install dependencies
run: pnpm --filter tachi-client... --filter . install
- name: Build Bokutachi
if: github.ref == 'refs/heads/main'
run: pnpm --filter tachi-client build
env:
VITE_GIT_REPO: "GitHub:zkrising/Tachi"
VITE_TCHIC_MODE: "boku"
VITE_GOATCOUNTER: "https://tachi.goatcounter.com/count"
VITE_RECAPTCHA_KEY: "6LcsYbIpAAAAAEJffjIXmbQcxj_SBZG7BnSPjF4L"
VITE_SERVER_URL: "https://boku.tachi.ac"
VITE_DISCORD: "https://discord.gg/E4n8ZZF5ES"
VITE_CDN_URL: "https://cdn-boku.tachi.ac"
TACHI_NAME: "Bokutachi"
BUILD_OUT_DIR: /home/runner/boku
- name: Build Kamaitachi
if: github.ref == 'refs/heads/main'
run: pnpm --filter tachi-client build
env:
VITE_MANDATE_LOGIN: true
VITE_GOATCOUNTER: "https://tachi.goatcounter.com/count"
VITE_SERVER_URL: "https://kamai.tachi.ac"
VITE_EAG_CLIENT_ID: "332B9789DEA10B94DB0E345A6F8ECF54BB86E6DD"
VITE_FLO_CLIENT_ID: "98B965554FB2341D969667F3D04CFC28F8C080ED"
VITE_MIN_CLIENT_ID: "A0DBDBB063CD800530EF01C6488B282137E0191E"
VITE_DISCORD: "https://discord.gg/NNgGJbpQUj"
VITE_TCHIC_MODE: "kamai"
VITE_CDN_URL: "https://cdn-kamai.tachi.ac"
VITE_GIT_REPO: "GitHub:zkrising/Tachi"
VITE_RECAPTCHA_KEY: "6LcsYbIpAAAAAEJffjIXmbQcxj_SBZG7BnSPjF4L"
TACHI_NAME: "Kamaitachi"
BUILD_OUT_DIR: /home/runner/kamai
- name: Deploy Kamaitachi
if: github.ref == 'refs/heads/main'
run: ssh ci@"$TACHI_HOST" 'rm -rf ~/tachi-client/kamai' && scp -r ~/kamai ci@"$TACHI_HOST":tachi-client
env:
TACHI_HOST: ${{secrets.TACHI_HOST}}
- name: Deploy Bokutachi
if: github.ref == 'refs/heads/main'
run: ssh ci@"$TACHI_HOST" 'rm -rf ~/tachi-client/boku' && scp -r ~/boku ci@"$TACHI_HOST":tachi-client
env:
TACHI_HOST: ${{secrets.TACHI_HOST}}
- name: Build Staging
run: pnpm --filter tachi-client build
env:
VITE_MANDATE_LOGIN: true
VITE_GOATCOUNTER: "https://tachi.goatcounter.com/count"
VITE_SERVER_URL: "https://staging.tachi.ac"
VITE_TCHIC_MODE: "omni"
VITE_CDN_URL: "https://cdn-staging.tachi.ac"
VITE_GIT_REPO: "GitHub:zkrising/Tachi"
VITE_RECAPTCHA_KEY: "6LcsYbIpAAAAAEJffjIXmbQcxj_SBZG7BnSPjF4L"
TACHI_NAME: "Tachi Staging"
BUILD_OUT_DIR: /home/runner/staging
- name: Deploy Staging
run: ssh ci@"$TACHI_HOST" 'rm -rf ~/tachi-client/staging' && scp -r ~/staging ci@"$TACHI_HOST":tachi-client
env:
TACHI_HOST: ${{secrets.TACHI_HOST}}