-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (73 loc) · 2.67 KB
/
deploy-prod.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
name: 'Deploy Production'
on:
push:
tags:
- v**
- '!**beta**'
jobs:
Deploy:
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get Docker Image Url
id: image
env:
CORE: harbor.ncuos.com/genius-auth/core
SSH_DEV: harbor.ncuos.com/genius-auth/ssh-server
run: |
echo CORE_LATEST=${CORE}:latest >> $GITHUB_OUTPUT
echo CORE_VERSION=${CORE}:${GITHUB_REF/refs\/tags\//} >> $GITHUB_OUTPUT
echo SSH_DEV_LATEST=${SSH_DEV}:latest >> $GITHUB_OUTPUT
echo SSH_DEV_VERSION=${SSH_DEV}:${GITHUB_REF/refs\/tags\//} >> $GITHUB_OUTPUT
- name: Build Site
run: |
cd web
pnpm install --frozen-lockfile
pnpm run build
- name: Build Core Binary
env:
GOPRIVATE: github.com/ncuhome
CGO_ENABLED: 0
run: go build -gcflags=-trimpath=$GOPATH -asmflags=-trimpath=$GOPATH -ldflags '-extldflags "-static" -s -w' -o runner --tags="web nomsgpack" ./cmd/core
- name: Build Core Docker Image
run: |
docker build . --file Dockerfile.ci \
--tag ${{ steps.image.outputs.CORE_VERSION }} \
--tag ${{ steps.image.outputs.CORE_LATEST }}
- name: Build sshDev Binary
env:
GOPRIVATE: github.com/ncuhome
CGO_ENABLED: 0
run: go build -gcflags=-trimpath=$GOPATH -asmflags=-trimpath=$GOPATH -ldflags '-extldflags "-static" -s -w' -o runner ./cmd/sshDev
- name: Build sshDev Docker Image
run: |
docker build . --file ./cmd/sshDev/Dockerfile.ci \
--tag ${{ steps.image.outputs.SSH_DEV_VERSION }} \
--tag ${{ steps.image.outputs.SSH_DEV_LATEST }}
- name: Push
run: |
docker push ${{ steps.image.outputs.CORE_VERSION }}
docker push ${{ steps.image.outputs.CORE_LATEST }}
docker push ${{ steps.image.outputs.SSH_DEV_VERSION }}
docker push ${{ steps.image.outputs.SSH_DEV_LATEST }}
- name: Update Deployments
uses: MultiMx/[email protected]
with:
k8s: |
prod:
backend: https://rancher.ncuos.com
token: ${{ secrets.CATTLE_TOKEN }}
dev:
backend: https://rancher.ncuhome.club
token: ${{ secrets.CATTLE_TOKEN_LOCAL }}
workloads: |
-
genius-auth:
core:
image: ${{ steps.image.outputs.CORE_VERSION }}
wait: true
-
genius-auth:
ssh-server:
image: ${{ steps.image.outputs.SSH_DEV_VERSION }}