update deploy cronjob

This commit is contained in:
adityap1337
2022-09-29 10:47:36 +08:00
parent 31b066f267
commit 1291f932d6
2 changed files with 41 additions and 1 deletions

40
.github/workflows/deploy-cronjob.yml vendored Normal file
View File

@@ -0,0 +1,40 @@
name: Deploy to Kube Cronjob
on:
workflow_call:
inputs:
app-name:
required: true
type: string
app-target:
required: true
type: string
image-tag:
required: true
type: string
secrets:
REGISTRY:
required: true
K8S_CONFIG:
required: true
jobs:
deploy-k8s:
name: Deploy Cronjob
runs-on: ubuntu-latest
steps:
- name: Deploy
env:
K8S_CONFIG: ${{secrets.K8S_CONFIG}}
REGISTRY: ${{ secrets.REGISTRY }}
APP: ${{ inputs.app-name }}
APPTARGET: ${{inputs.app-target}}
TAG: ${{inputs.image-tag}}
run: |
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
chmod +x kubectl
mv kubectl /usr/local/bin/
cd ~
mkdir .kube
echo "$K8S_CONFIG" > .kube/config
kubectl set image cronjob/$APP $APPTARGET=$REGISTRY:$TAG

View File

@@ -20,7 +20,7 @@ on:
jobs:
deploy-k8s:
name: Deploy
name: Deploy to deployment
runs-on: ubuntu-latest
steps:
- name: Deploy