add k8s
This commit is contained in:
62
.github/workflows/deployk8s.yaml
vendored
Normal file
62
.github/workflows/deployk8s.yaml
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
tag:
|
||||
required: false
|
||||
type: string
|
||||
default: latest
|
||||
debug:
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
migrate:
|
||||
type: boolean
|
||||
default: false
|
||||
build:
|
||||
type: boolean
|
||||
default: false
|
||||
environment:
|
||||
type: string
|
||||
required: true
|
||||
host:
|
||||
type: string
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
prenotify:
|
||||
uses: HUB/workflows/.github/workflows/notify.yaml@main
|
||||
with:
|
||||
result: 'started'
|
||||
name: k8s deploy ${{ inputs.environment }} tag ${{ inputs.tag }}
|
||||
secrets: inherit
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CR_REGISTRY: crp8vh46gd976oq8ipla
|
||||
CR_REPO: ${{ github.event.repository.name }}
|
||||
TAG: ${{ inputs.tag }}
|
||||
steps:
|
||||
- name: Argo Login
|
||||
uses: clowdhaus/argo-cd-action/@main
|
||||
with:
|
||||
version: 2.13.3
|
||||
command: login
|
||||
options: ${{ vars.ARGO_HOST }} --username ${{ vars.ARGO_USER }} --password ${{ secrets.ARGO_PASSWORD }}
|
||||
- name: Change tag name
|
||||
uses: clowdhaus/argo-cd-action/@main
|
||||
with:
|
||||
version: 2.13.3
|
||||
command: app set ${{ inputs.environment }} --parameter images.${{github.event.repository.name}}=${{ inputs.tag }}
|
||||
- name: Sync changes
|
||||
uses: clowdhaus/argo-cd-action/@main
|
||||
with:
|
||||
version: 2.13.3
|
||||
command: app sync ${{ inputs.environment }}
|
||||
notify:
|
||||
needs: [deploy]
|
||||
if: always()
|
||||
uses: HUB/workflows/.github/workflows/notify.yaml@main
|
||||
with:
|
||||
result: ${{ needs.deploy.result}}
|
||||
name: k8s deploy ${{ inputs.environment }} tag ${{ inputs.tag }}
|
||||
secrets: inherit
|
||||
Reference in New Issue
Block a user