improve: 优化 sshDev/client linux 用户处理逻辑 #39
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
AUTH: harbor.ncuos.com/genius-auth/gate | |
FE: harbor.ncuos.com/genius-auth/fe | |
SSH_SERVER: harbor.ncuos.com/genius-auth/ssh-server | |
SSH_CLIENT: harbor.ncuos.com/genius-auth/ssh-client | |
run: | | |
echo CORE_LATEST=${CORE}:latest >> $GITHUB_OUTPUT | |
echo CORE_VERSION=${CORE}:${GITHUB_REF/refs\/tags\//} >> $GITHUB_OUTPUT | |
echo AUTH_LATEST=${AUTH}:latest >> $GITHUB_OUTPUT | |
echo AUTH_VERSION=${AUTH}:${GITHUB_REF/refs\/tags\//} >> $GITHUB_OUTPUT | |
echo FE_LATEST=${FE}:latest >> $GITHUB_OUTPUT | |
echo FE_VERSION=${FE}:${GITHUB_REF/refs\/tags\//} >> $GITHUB_OUTPUT | |
echo SSH_SERVER_LATEST=${SSH_SERVER}:latest >> $GITHUB_OUTPUT | |
echo SSH_SERVER_VERSION=${SSH_SERVER}:${GITHUB_REF/refs\/tags\//} >> $GITHUB_OUTPUT | |
echo SSH_CLIENT_LATEST=${SSH_CLIENT}:latest >> $GITHUB_OUTPUT | |
echo SSH_CLIENT_VERSION=${SSH_CLIENT}:${GITHUB_REF/refs\/tags\//} >> $GITHUB_OUTPUT | |
- name: Build Site | |
run: cd web && pnpm i && 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="core web" ./cmd/core | |
- name: Build Core Docker Image | |
run: | | |
docker build . --file Dockerfile \ | |
--tag ${{ steps.image.outputs.CORE_VERSION }} \ | |
--tag ${{ steps.image.outputs.CORE_LATEST }} | |
- name: Build Auth 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="auth" ./cmd/auth | |
- name: Build Auth Docker Image | |
run: | | |
docker build . --file Dockerfile \ | |
--tag ${{ steps.image.outputs.AUTH_VERSION }} \ | |
--tag ${{ steps.image.outputs.AUTH_LATEST }} | |
- name: Build Fe 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="fe web" ./cmd/fe | |
- name: Build Fe Docker Image | |
run: | | |
docker build . --file Dockerfile \ | |
--tag ${{ steps.image.outputs.FE_VERSION }} \ | |
--tag ${{ steps.image.outputs.FE_LATEST }} | |
- name: Build sshDev Server 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/server | |
- name: Build sshDev Server Docker Image | |
run: | | |
docker build . --file Dockerfile \ | |
--tag ${{ steps.image.outputs.SSH_SERVER_VERSION }} \ | |
--tag ${{ steps.image.outputs.SSH_SERVER_LATEST }} | |
- name: Build sshDev Client 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/client | |
- name: Build sshDev Client Docker Image | |
run: | | |
docker build . --file ./cmd/sshDev/client/Dockerfile \ | |
--tag ${{ steps.image.outputs.SSH_CLIENT_VERSION }} \ | |
--tag ${{ steps.image.outputs.SSH_CLIENT_LATEST }} | |
- name: Push | |
run: | | |
docker push ${{ steps.image.outputs.CORE_VERSION }} | |
docker push ${{ steps.image.outputs.CORE_LATEST }} | |
docker push ${{ steps.image.outputs.AUTH_VERSION }} | |
docker push ${{ steps.image.outputs.AUTH_LATEST }} | |
docker push ${{ steps.image.outputs.FE_VERSION }} | |
docker push ${{ steps.image.outputs.FE_LATEST }} | |
docker push ${{ steps.image.outputs.SSH_SERVER_VERSION }} | |
docker push ${{ steps.image.outputs.SSH_SERVER_LATEST }} | |
docker push ${{ steps.image.outputs.SSH_CLIENT_VERSION }} | |
docker push ${{ steps.image.outputs.SSH_CLIENT_LATEST }} | |
- name: Update Core Dev Deployment | |
uses: MultiMx/[email protected] | |
with: | |
backend: 'https://rancher.ncuhome.club' | |
token: ${{ secrets.CATTLE_TOKEN_LOCAL }} | |
namespace: 'genius-auth' | |
deployment: 'core' | |
image: ${{ steps.image.outputs.CORE_VERSION }} | |
wait: true | |
- name: Update Auth Dev Deployment | |
uses: MultiMx/[email protected] | |
with: | |
backend: 'https://rancher.ncuhome.club' | |
token: ${{ secrets.CATTLE_TOKEN_LOCAL }} | |
namespace: 'genius-auth' | |
deployment: 'auth' | |
image: ${{ steps.image.outputs.AUTH_VERSION }} | |
- name: Update Fe Dev Deployment | |
uses: MultiMx/[email protected] | |
with: | |
backend: 'https://rancher.ncuhome.club' | |
token: ${{ secrets.CATTLE_TOKEN_LOCAL }} | |
namespace: 'genius-auth' | |
deployment: 'fe' | |
image: ${{ steps.image.outputs.FE_VERSION }} | |
- name: Update sshDev Server Dev Deployment | |
uses: MultiMx/[email protected] | |
with: | |
backend: 'https://rancher.ncuhome.club' | |
token: ${{ secrets.CATTLE_TOKEN_LOCAL }} | |
namespace: 'genius-auth' | |
deployment: 'ssh-dev-grpc-server' | |
image: ${{ steps.image.outputs.SSH_SERVER_VERSION }} | |
- name: Update sshDev Client Dev Deployment | |
uses: MultiMx/[email protected] | |
with: | |
backend: 'https://rancher.ncuhome.club' | |
token: ${{ secrets.CATTLE_TOKEN_LOCAL }} | |
namespace: 'genius-auth' | |
deployment: 'ssh-server-dev' | |
image: ${{ steps.image.outputs.SSH_CLIENT_VERSION }} | |
- name: Update Core Prod Deployment | |
uses: MultiMx/[email protected] | |
with: | |
backend: 'https://rancher.ncuos.com' | |
token: ${{ secrets.CATTLE_TOKEN }} | |
namespace: 'genius-auth' | |
deployment: 'core' | |
image: ${{ steps.image.outputs.CORE_VERSION }} | |
wait: true | |
- name: Update Auth Prod Deployment | |
uses: MultiMx/[email protected] | |
with: | |
backend: 'https://rancher.ncuos.com' | |
token: ${{ secrets.CATTLE_TOKEN }} | |
namespace: 'genius-auth' | |
deployment: 'auth' | |
image: ${{ steps.image.outputs.AUTH_VERSION }} | |
- name: Update Fe Prod Deployment | |
uses: MultiMx/[email protected] | |
with: | |
backend: 'https://rancher.ncuos.com' | |
token: ${{ secrets.CATTLE_TOKEN }} | |
namespace: 'genius-auth' | |
deployment: 'fe' | |
image: ${{ steps.image.outputs.FE_VERSION }} | |
- name: Update sshDev Server Prod Deployment | |
uses: MultiMx/[email protected] | |
with: | |
backend: 'https://rancher.ncuos.com' | |
token: ${{ secrets.CATTLE_TOKEN }} | |
namespace: 'genius-auth' | |
deployment: 'ssh-dev-grpc-server' | |
image: ${{ steps.image.outputs.SSH_SERVER_VERSION }} | |
- name: Update sshDev Client Prod Deployment | |
uses: MultiMx/[email protected] | |
with: | |
backend: 'https://rancher.ncuos.com' | |
token: ${{ secrets.CATTLE_TOKEN }} | |
namespace: 'genius-auth' | |
deployment: 'ssh-server-dev' | |
image: ${{ steps.image.outputs.SSH_CLIENT_VERSION }} |