ci: K8sQuickUpdateAction 问题修复 #62
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_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 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_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 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 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 \ | |
--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.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_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: | |
auth: | |
image: ${{ steps.image.outputs.AUTH_VERSION }} | |
fe: | |
image: ${{ steps.image.outputs.FE_VERSION }} | |
ssh-server: | |
image: ${{ steps.image.outputs.SSH_DEV_VERSION }} |