update deploy cronjob
This commit is contained in:
40
.github/workflows/deploy-cronjob.yml
vendored
Normal file
40
.github/workflows/deploy-cronjob.yml
vendored
Normal 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
|
||||||
2
.github/workflows/deploy.yml
vendored
2
.github/workflows/deploy.yml
vendored
@@ -20,7 +20,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy-k8s:
|
deploy-k8s:
|
||||||
name: Deploy
|
name: Deploy to deployment
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
|
|||||||
Reference in New Issue
Block a user