17 Commits

Author SHA1 Message Date
c621e392f4 fix message deploy 2026-02-20 16:47:23 +03:00
1540fce056 Merge pull request 'fix: cache only when build succesfull' (#59) from fix-build-cache into main
Reviewed-on: #59
Reviewed-by: nikitos <andriyanov@me.com>
2025-12-30 14:30:27 +00:00
0dcd1b5a97 fix: cache only when build succesfull 2025-12-30 07:24:30 +00:00
3c3cf1e01e Update .github/workflows/deployk8s.yaml 2025-12-19 13:08:06 +00:00
32235cb102 Update .github/workflows/deployk8s.yaml 2025-12-19 13:03:50 +00:00
a750a6b0cd Update .github/workflows/deployk8s.yaml 2025-12-19 12:54:49 +00:00
04914682ab Update .gitea/actions/k8s/action.yaml 2025-12-19 12:48:48 +00:00
26d0ef1b21 Update .github/workflows/deployk8s.yaml 2025-12-19 12:44:06 +00:00
b91d822d12 Update .github/workflows/deployk8s.yaml 2025-12-19 12:30:34 +00:00
6b3551e14e Update .gitea/actions/k8s/action.yaml 2025-12-19 12:29:30 +00:00
455f632cab Update .github/workflows/deployk8s.yaml 2025-12-19 12:19:14 +00:00
09181ac7b1 Update .gitea/actions/k8s/action.yaml 2025-12-19 12:15:16 +00:00
856783726d Update .gitea/actions/k8s/action.yaml 2025-12-19 12:15:03 +00:00
378b930ccc Update .gitea/actions/k8s/action.yaml 2025-12-19 12:14:45 +00:00
eeb15eb7dc Update .github/workflows/deployk8s.yaml 2025-12-19 12:10:24 +00:00
99c7507dd5 Update .github/workflows/deployk8s.yaml 2025-12-19 12:09:09 +00:00
6f79b96a0b Update .github/workflows/deployk8s.yaml 2025-12-19 12:06:43 +00:00
3 changed files with 40 additions and 12 deletions

View File

@@ -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,40 +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 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 ${{github.event.repository.name}}
command: app actions run ${{ inputs.environment }} run-tests --kind Deployment --resource-name ${{ inputs.appName }}

View File

@@ -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

View File

@@ -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
@@ -55,4 +71,4 @@ jobs:
VK_TEAMS_CHAT_ID: ${{ secrets.VK_TEAMS_CHAT_ID }}
with:
result: ${{ steps.k8s_deploy.outcome }}
name: k8s deploy ${{ inputs.environment }} tag ${{ inputs.tag }}
name: deploy ${{ inputs.environment }} tag ${{ inputs.tag }}