Compare commits
25 Commits
new-new
...
1540fce056
| Author | SHA1 | Date | |
|---|---|---|---|
| 1540fce056 | |||
| 0dcd1b5a97 | |||
| 3c3cf1e01e | |||
| 32235cb102 | |||
| a750a6b0cd | |||
| 04914682ab | |||
| 26d0ef1b21 | |||
| b91d822d12 | |||
| 6b3551e14e | |||
| 455f632cab | |||
| 09181ac7b1 | |||
| 856783726d | |||
| 378b930ccc | |||
| eeb15eb7dc | |||
| 99c7507dd5 | |||
| 6f79b96a0b | |||
| ef5149864b | |||
| f906007246 | |||
| 7d47da47a3 | |||
| 8306409d93 | |||
| 6efe8999bc | |||
| d558a37736 | |||
| 42914c5104 | |||
| a2c38737b4 | |||
| 2a6b52c461 |
@@ -14,6 +14,18 @@ inputs:
|
||||
secrets:
|
||||
required: false
|
||||
type: string
|
||||
appName:
|
||||
type: string
|
||||
required: true
|
||||
optionName:
|
||||
type: string
|
||||
required: true
|
||||
tests:
|
||||
type: bool
|
||||
default: false
|
||||
vault:
|
||||
type: bool
|
||||
default: false
|
||||
|
||||
runs:
|
||||
using: 'composite'
|
||||
@@ -28,34 +40,40 @@ runs:
|
||||
uses: clowdhaus/argo-cd-action/@main
|
||||
with:
|
||||
version: 3.1.3
|
||||
command: app set ${{ inputs.environment }} --parameter images.${{github.event.repository.name}}=${{ inputs.tag }}
|
||||
command: app set ${{ inputs.environment }} --parameter ${{ inputs.optionName }}=${{ inputs.tag }}
|
||||
- name: Sync changes
|
||||
if: ${{ inputs.migrate == 'true' }}
|
||||
uses: clowdhaus/argo-cd-action/@main
|
||||
with:
|
||||
version: 3.1.3
|
||||
command: app sync ${{ inputs.environment }} --resource apps:Deployment:${{github.event.repository.name}}
|
||||
command: app sync ${{ inputs.environment }} --resource apps:Deployment:${{ inputs.appName }}
|
||||
- name: Migrate
|
||||
if: ${{ inputs.migrate == 'true' }}
|
||||
uses: clowdhaus/argo-cd-action/@main
|
||||
with:
|
||||
version: 3.1.3
|
||||
command: app actions run ${{ inputs.environment }} migrate --kind Deployment --resource-name ${{github.event.repository.name}}
|
||||
command: app actions run ${{ inputs.environment }} migrate --kind Deployment --resource-name ${{ inputs.appName }}
|
||||
- name: Sync related deployments
|
||||
shell: bash
|
||||
run: |
|
||||
for name in $(argocd app resources ${{ inputs.environment }} | grep Deploy | grep ${{ github.event.repository.name }} | awk '{print($4)}'); do
|
||||
for name in $(argocd app resources ${{ inputs.environment }} | grep Deploy | grep ${{ inputs.appName }} | awk '{print($4)}'); do
|
||||
echo "Syncing $name"
|
||||
argocd app sync ${{ inputs.environment }} --resource "$name"
|
||||
argocd app sync ${{ inputs.environment }} --resource apps:Deployment:$name;
|
||||
done
|
||||
|
||||
- name: Refresh secret
|
||||
if: ${{ inputs.vault == 'true' }}
|
||||
uses: clowdhaus/argo-cd-action/@main
|
||||
with:
|
||||
version: 3.1.3
|
||||
command: app actions run ${{ inputs.environment }} refresh --kind ExternalSecret --resource-name vault-${{github.event.repository.name}}
|
||||
command: app actions run ${{ inputs.environment }} refresh --kind ExternalSecret --resource-name vault-${{ inputs.appName }}
|
||||
- name: Restart service
|
||||
uses: clowdhaus/argo-cd-action/@main
|
||||
with:
|
||||
version: 3.1.3
|
||||
command: app actions run ${{ inputs.environment }} restart --kind Deployment --resource-name ${{github.event.repository.name}}
|
||||
command: app actions run ${{ inputs.environment }} restart --kind Deployment --resource-name ${{ inputs.appName }}
|
||||
- name: Run Tests
|
||||
if: ${{ inputs.tests == 'true' }}
|
||||
uses: clowdhaus/argo-cd-action/@main
|
||||
with:
|
||||
version: 3.1.3
|
||||
command: app actions run ${{ inputs.environment }} run-tests --kind Deployment --resource-name ${{ inputs.appName }}
|
||||
4
.github/workflows/build.yaml
vendored
4
.github/workflows/build.yaml
vendored
@@ -99,7 +99,7 @@ jobs:
|
||||
type=local,dest=/cache/${{ github.repository }}/buildx-cache-new,mode=max
|
||||
|
||||
- name: Move new cache if it exists
|
||||
if: always()
|
||||
if: steps.build-step.outcome == 'success'
|
||||
run: |
|
||||
mkdir -p /cache/${{ github.repository }}
|
||||
if [ -d /cache/${{ github.repository }}/buildx-cache-new ]; then
|
||||
@@ -111,7 +111,7 @@ jobs:
|
||||
fi
|
||||
|
||||
- name: Save Docker layer cache
|
||||
if: always()
|
||||
if: steps.build-step.outcome == 'success'
|
||||
uses: actions/cache/save@v4
|
||||
with:
|
||||
path: /cache/${{ github.repository }}/buildx-cache
|
||||
|
||||
16
.github/workflows/deployk8s.yaml
vendored
16
.github/workflows/deployk8s.yaml
vendored
@@ -21,6 +21,18 @@ on:
|
||||
host:
|
||||
type: string
|
||||
required: true
|
||||
name:
|
||||
type: string
|
||||
required: false
|
||||
option:
|
||||
type: string
|
||||
required: false
|
||||
tests:
|
||||
type: string
|
||||
default: true
|
||||
vault:
|
||||
type: string
|
||||
default: true
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
@@ -47,6 +59,10 @@ jobs:
|
||||
environment: ${{ inputs.environment }}
|
||||
tag: ${{ inputs.tag }}
|
||||
migrate: ${{ inputs.migrate }}
|
||||
appName: ${{ inputs.name || github.event.repository.name }}
|
||||
optionName: ${{ inputs.option || format('images.{0}', github.event.repository.name) }}
|
||||
tests: ${{ inputs.tests }}
|
||||
vault: ${{ inputs.vault }}
|
||||
- name: post-notify
|
||||
if: always()
|
||||
uses: https://bb.hublab.ru/HUB/workflows/.gitea/actions/vk-notify@main
|
||||
|
||||
Reference in New Issue
Block a user