deploy
This commit is contained in:
48
.gitea/actions/k8s/action.yaml
Normal file
48
.gitea/actions/k8s/action.yaml
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
name: 'deploy'
|
||||||
|
description: 'deploy'
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
environment:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
tag:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
migrate:
|
||||||
|
type: bool
|
||||||
|
default: false
|
||||||
|
secrets:
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: 'composite'
|
||||||
|
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 ${{ fromJSON(inputs.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: Migrate
|
||||||
|
if: ${{ inputs.migrate == 'true' }}
|
||||||
|
uses: clowdhaus/argo-cd-action/@main
|
||||||
|
with:
|
||||||
|
version: 2.13.3
|
||||||
|
command: app set ${{ inputs.environment }} --parameter migrations.${{github.event.repository.name}}=PreSync
|
||||||
|
- name: Sync changes
|
||||||
|
uses: clowdhaus/argo-cd-action/@main
|
||||||
|
with:
|
||||||
|
version: 2.13.3
|
||||||
|
command: app sync ${{ inputs.environment }}
|
||||||
|
- name: Migrate
|
||||||
|
if: ${{ inputs.migrate == 'true' }}
|
||||||
|
uses: clowdhaus/argo-cd-action/@main
|
||||||
|
with:
|
||||||
|
version: 2.13.3
|
||||||
|
command: app unset ${{ inputs.environment }} --parameter migrations.${{github.event.repository.name}}
|
||||||
34
.github/workflows/deployk8s.yaml
vendored
34
.github/workflows/deployk8s.yaml
vendored
@@ -37,34 +37,14 @@ jobs:
|
|||||||
result: 'started'
|
result: 'started'
|
||||||
secrets: ${{ toJSON(secrets) }}
|
secrets: ${{ toJSON(secrets) }}
|
||||||
name: deploy ${{ inputs.environment }} tag ${{ inputs.tag }}
|
name: deploy ${{ inputs.environment }} tag ${{ inputs.tag }}
|
||||||
- name: Argo Login
|
- name: deploy
|
||||||
uses: clowdhaus/argo-cd-action/@main
|
uses: https://bb.hublab.ru/HUB/workflows/.gitea/actions/k8s@HEAD
|
||||||
with:
|
with:
|
||||||
version: 2.13.3
|
secrets: ${{ toJSON(secrets) }}
|
||||||
command: login
|
environment: ${{ inputs.environment }}
|
||||||
options: ${{ vars.ARGO_HOST }} --username ${{ vars.ARGO_USER }} --password ${{ secrets.ARGO_PASSWORD }}
|
tag: ${{ inputs.tag }}
|
||||||
- name: Change tag name
|
migrate: ${{ inputs.migrate }}
|
||||||
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: Migrate
|
|
||||||
if: ${{ inputs.migrate == 'true' }}
|
|
||||||
uses: clowdhaus/argo-cd-action/@main
|
|
||||||
with:
|
|
||||||
version: 2.13.3
|
|
||||||
command: app set ${{ inputs.environment }} --parameter migrations.${{github.event.repository.name}}=PreSync
|
|
||||||
- name: Sync changes
|
|
||||||
uses: clowdhaus/argo-cd-action/@main
|
|
||||||
with:
|
|
||||||
version: 2.13.3
|
|
||||||
command: app sync ${{ inputs.environment }}
|
|
||||||
- name: Migrate
|
|
||||||
if: ${{ inputs.migrate == 'true' }}
|
|
||||||
uses: clowdhaus/argo-cd-action/@main
|
|
||||||
with:
|
|
||||||
version: 2.13.3
|
|
||||||
command: app unset ${{ inputs.environment }} --parameter migrations.${{github.event.repository.name}}
|
|
||||||
notify:
|
notify:
|
||||||
needs: [deploy]
|
needs: [deploy]
|
||||||
if: always()
|
if: always()
|
||||||
|
|||||||
Reference in New Issue
Block a user