Refactor: migrate kubectl to flux
All checks were successful
Build image / release-image (push) Successful in 1m7s
All checks were successful
Build image / release-image (push) Successful in 1m7s
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
name: Build image and deploy
|
||||
|
||||
on:
|
||||
push
|
||||
name: Build image
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
release-image:
|
||||
@@ -46,33 +44,8 @@ jobs:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
platforms: |
|
||||
linux/amd64
|
||||
linux/amd64
|
||||
push: true
|
||||
tags: |
|
||||
${{ env.CONTAINER_REGISTRY }}/${{ env.GITEA_REPO }}:${{ env.GITEA_REF_NAME }}
|
||||
${{ env.CONTAINER_REGISTRY }}/${{ env.GITEA_REPO }}:${{ env.GITEA_TAG }}
|
||||
|
||||
deploy:
|
||||
needs: release-image
|
||||
runs-on: imgbuilder
|
||||
container:
|
||||
image: gitea.konchin.com/image/kubectl
|
||||
credentials:
|
||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup kubeconfig
|
||||
run: |
|
||||
echo "${{ secrets.KUBE_CONFIG }}" > .kubeconfig
|
||||
cat .kubeconfig
|
||||
|
||||
- name: Deploy
|
||||
run: |
|
||||
kubectl --kubeconfig .kubeconfig apply -Rf k8s/
|
||||
|
||||
- name: Rollout restart
|
||||
run: |
|
||||
kubectl --kubeconfig .kubeconfig -n algo-dcbot rollout restart deployment algo-dcbot
|
||||
${{ env.CONTAINER_REGISTRY }}/${{ env.GITEA_REPO }}:${{ env.GITEA_TAG }}
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: algo-dcbot
|
||||
namespace: algo-dcbot
|
||||
labels:
|
||||
app: algo-dcbot
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: algo-dcbot
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: algo-dcbot
|
||||
spec:
|
||||
containers:
|
||||
- name: dcbot
|
||||
image: gitea.konchin.com/service/algo-dcbot:latest
|
||||
env:
|
||||
- name: DC_TOKEN
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: algo-dcbot-secret
|
||||
key: DC_TOKEN
|
||||
- name: DC_CLIENTID
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: algo-dcbot-secret
|
||||
key: DC_CLIENTID
|
||||
- name: ADMIN_ID
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: algo-dcbot-secret
|
||||
key: ADMIN_ID
|
||||
- name: DEFAULT_ROLE
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: algo-dcbot-secret
|
||||
key: DEFAULT_ROLE
|
||||
imagePullSecrets:
|
||||
- name: regcred
|
||||
Reference in New Issue
Block a user