-
Notifications
You must be signed in to change notification settings - Fork 5
89 lines (72 loc) · 2.61 KB
/
DevelopServerDeploy.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
name: Develop Server Deploy
on:
push:
branches: [ develop ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: sudo apt-get update
- run: sudo apt-get install -y libkrb5-dev
- name: Use Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: 20
cache: npm
- name: Install node_modules
run: npm install
- name: Lint
run: npm run lint
- name: Test
run: npm run test
build:
needs: test
runs-on: wgd-dev
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: 20
cache: npm
- name: Build action runner
run: docker build -t "wgd-action-runner:develop" --build-arg "GIT_SHA=${GITHUB_SHA}" apps/wgd-action-runner
- name: Build hugo docs
run: |
docker run \
-v "${GITHUB_WORKSPACE}/hugo:/site" \
-v "${GITHUB_WORKSPACE}/website:/website" \
-v "/var/www/dev.wikigdrive.com:/dist/hugo" \
--env CONFIG_TOML="/site/config/_default/config.toml" --env BASE_URL="https://dev.wikigdrive.com" \
wgd-action-runner:develop /steps/step_render_hugo
- name: Copy index for vite
run: mkdir -p ${GITHUB_WORKSPACE}/dist/hugo && cp -rf /var/www/dev.wikigdrive.com/* ${GITHUB_WORKSPACE}/dist/hugo
- uses: docker/build-push-action@v6
with:
tags: "wikigdrive-develop:${{ github.sha }},wikigdrive-develop:latest"
push: false
build-args: "{'--build-arg': 'GIT_SHA=${{ github.sha }}'}"
- name: Stop and remove
run: docker stop wikigdrive-develop ; docker rm wikigdrive-develop
continue-on-error: true
- name: Start
run: |
docker run -d --name wikigdrive-develop \
--restart unless-stopped \
--network nginx \
--tmpfs /tmp \
-v wikiGDriveDevelop:/data \
-v /home/wikigdrive/service_account.json:/service_account.json \
-v /home/wikigdrive/env.develop:/usr/src/app/.env \
-v /var/run/docker.sock:/var/run/docker.sock \
-v "/var/www/dev.wikigdrive.com:/usr/src/app/dist/hugo" \
-e "GIT_SHA=${GITHUB_SHA}" \
-e "ZIPKIN_URL=https://dev.wikigdrive.com/zipkin" \
-e "ZIPKIN_SERVICE=wikigdrive-develop" \
--publish 127.0.0.1:4000:3000 \
"wikigdrive-develop:${GITHUB_SHA}" wikigdrive \
--service_account /service_account.json \
--share_email mie-docs-wikigdrive@wikigdrive.iam.gserviceaccount.com \
--workdir /data \
server 3000