This commit is contained in:
2025-04-17 15:59:04 +03:00
parent 8123ac22d0
commit d135fc2dc4
2 changed files with 55 additions and 27 deletions

View 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}}