Compare commits
56 Commits
a6877dda7e
...
lil-fix
| Author | SHA1 | Date | |
|---|---|---|---|
| c621e392f4 | |||
| 1540fce056 | |||
| 0dcd1b5a97 | |||
| 3c3cf1e01e | |||
| 32235cb102 | |||
| a750a6b0cd | |||
| 04914682ab | |||
| 26d0ef1b21 | |||
| b91d822d12 | |||
| 6b3551e14e | |||
| 455f632cab | |||
| 09181ac7b1 | |||
| 856783726d | |||
| 378b930ccc | |||
| eeb15eb7dc | |||
| 99c7507dd5 | |||
| 6f79b96a0b | |||
| ef5149864b | |||
| f906007246 | |||
| 7d47da47a3 | |||
| 8306409d93 | |||
| 6efe8999bc | |||
| d558a37736 | |||
| 42914c5104 | |||
| a2c38737b4 | |||
| bd4d6d5655 | |||
| 2a6b52c461 | |||
| d4987ff717 | |||
| feb7bf12ed | |||
| 99393d16ce | |||
| 2a74089e37 | |||
| 3398c4f76f | |||
| 26a57c2206 | |||
| 38d562af9a | |||
| 64eb83f489 | |||
| 8ebded5c3f | |||
| ae79a067c4 | |||
| 6319fea371 | |||
| 768a35108a | |||
| cc4ec94402 | |||
| 872706e2b6 | |||
| d4604aa6fb | |||
| 2e82989ca0 | |||
| a67aaf3ca9 | |||
| 5ac880d37d | |||
| fd5d7e2cd4 | |||
| 3c01a716e6 | |||
| f0f354a8d4 | |||
| 8864f9585e | |||
| b7fb2ed335 | |||
| 760b6a8257 | |||
| d7bae2b72f | |||
| 2e4141834e | |||
| 4576ab5751 | |||
| 5114bcf9fe | |||
| 6d04254346 |
@@ -14,6 +14,18 @@ inputs:
|
|||||||
secrets:
|
secrets:
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
|
appName:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
optionName:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
tests:
|
||||||
|
type: bool
|
||||||
|
default: false
|
||||||
|
vault:
|
||||||
|
type: bool
|
||||||
|
default: false
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: 'composite'
|
using: 'composite'
|
||||||
@@ -28,31 +40,40 @@ runs:
|
|||||||
uses: clowdhaus/argo-cd-action/@main
|
uses: clowdhaus/argo-cd-action/@main
|
||||||
with:
|
with:
|
||||||
version: 3.1.3
|
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
|
- name: Sync changes
|
||||||
if: ${{ inputs.migrate == 'true' }}
|
if: ${{ inputs.migrate == 'true' }}
|
||||||
uses: clowdhaus/argo-cd-action/@main
|
uses: clowdhaus/argo-cd-action/@main
|
||||||
with:
|
with:
|
||||||
version: 3.1.3
|
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
|
- name: Migrate
|
||||||
if: ${{ inputs.migrate == 'true' }}
|
if: ${{ inputs.migrate == 'true' }}
|
||||||
uses: clowdhaus/argo-cd-action/@main
|
uses: clowdhaus/argo-cd-action/@main
|
||||||
with:
|
with:
|
||||||
version: 3.1.3
|
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 changes
|
- name: Sync related deployments
|
||||||
uses: clowdhaus/argo-cd-action/@main
|
shell: bash
|
||||||
with:
|
run: |
|
||||||
version: 3.1.3
|
for name in $(argocd app resources ${{ inputs.environment }} | grep Deploy | grep ${{ inputs.appName }} | awk '{print($4)}'); do
|
||||||
command: app sync ${{ inputs.environment }} --resource 'apps:Deployment:*'
|
echo "Syncing $name"
|
||||||
|
argocd app sync ${{ inputs.environment }} --resource apps:Deployment:$name;
|
||||||
|
done
|
||||||
- name: Refresh secret
|
- name: Refresh secret
|
||||||
|
if: ${{ inputs.vault == 'true' }}
|
||||||
uses: clowdhaus/argo-cd-action/@main
|
uses: clowdhaus/argo-cd-action/@main
|
||||||
with:
|
with:
|
||||||
version: 3.1.3
|
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
|
- name: Restart service
|
||||||
uses: clowdhaus/argo-cd-action/@main
|
uses: clowdhaus/argo-cd-action/@main
|
||||||
with:
|
with:
|
||||||
version: 3.1.3
|
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 }}
|
||||||
8
.github/workflows/build.yaml
vendored
8
.github/workflows/build.yaml
vendored
@@ -73,7 +73,7 @@ jobs:
|
|||||||
uses: actions/cache/restore@v4
|
uses: actions/cache/restore@v4
|
||||||
with:
|
with:
|
||||||
path: /cache/${{ github.repository }}/buildx-cache
|
path: /cache/${{ github.repository }}/buildx-cache
|
||||||
key: ${{ runner.os }}-${{ github.repository }}-buildx-${{ hashFiles('Dockerfile', '**/requirements.txt', '**/*lock*', '**/package-lock.json', '**/poetry.lock') }}
|
key: ${{ runner.os }}-${{ github.repository }}-buildx-${{ hashFiles(format('{0}/Dockerfile', github.workspace), format('{0}/**/requirements.txt', github.workspace), format('{0}/**/*lock*', github.workspace), format('{0}/**/package-lock.json', github.workspace), format('{0}/**/poetry.lock', github.workspace)) }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-${{ github.repository }}-buildx-
|
${{ runner.os }}-${{ github.repository }}-buildx-
|
||||||
${{ runner.os }}-buildx-
|
${{ runner.os }}-buildx-
|
||||||
@@ -99,7 +99,7 @@ jobs:
|
|||||||
type=local,dest=/cache/${{ github.repository }}/buildx-cache-new,mode=max
|
type=local,dest=/cache/${{ github.repository }}/buildx-cache-new,mode=max
|
||||||
|
|
||||||
- name: Move new cache if it exists
|
- name: Move new cache if it exists
|
||||||
if: always()
|
if: steps.build-step.outcome == 'success'
|
||||||
run: |
|
run: |
|
||||||
mkdir -p /cache/${{ github.repository }}
|
mkdir -p /cache/${{ github.repository }}
|
||||||
if [ -d /cache/${{ github.repository }}/buildx-cache-new ]; then
|
if [ -d /cache/${{ github.repository }}/buildx-cache-new ]; then
|
||||||
@@ -111,11 +111,11 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Save Docker layer cache
|
- name: Save Docker layer cache
|
||||||
if: always()
|
if: steps.build-step.outcome == 'success'
|
||||||
uses: actions/cache/save@v4
|
uses: actions/cache/save@v4
|
||||||
with:
|
with:
|
||||||
path: /cache/${{ github.repository }}/buildx-cache
|
path: /cache/${{ github.repository }}/buildx-cache
|
||||||
key: ${{ runner.os }}-${{ github.repository }}-buildx-${{ hashFiles('Dockerfile', '**/requirements.txt', '**/*lock*', '**/package-lock.json', '**/poetry.lock') }}
|
key: ${{ runner.os }}-${{ github.repository }}-buildx-${{ hashFiles(format('{0}/Dockerfile', github.workspace), format('{0}/**/requirements.txt', github.workspace), format('{0}/**/*lock*', github.workspace), format('{0}/**/package-lock.json', github.workspace), format('{0}/**/poetry.lock', github.workspace)) }}
|
||||||
|
|
||||||
- name: Notify (result)
|
- name: Notify (result)
|
||||||
if: always()
|
if: always()
|
||||||
|
|||||||
20
.github/workflows/deployk8s.yaml
vendored
20
.github/workflows/deployk8s.yaml
vendored
@@ -21,10 +21,22 @@ on:
|
|||||||
host:
|
host:
|
||||||
type: string
|
type: string
|
||||||
required: true
|
required: true
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
required: false
|
||||||
|
option:
|
||||||
|
type: string
|
||||||
|
required: false
|
||||||
|
tests:
|
||||||
|
type: string
|
||||||
|
default: true
|
||||||
|
vault:
|
||||||
|
type: string
|
||||||
|
default: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
if: contains(format(',{0},', vars.ADMIN_USERS), format(',{0},', github.actor)) || inputs.environment=='stage'
|
if: ${{ contains(format(',{0},', vars.ADMIN_USERS), format(',{0},', github.actor)) || startsWith(inputs.environment, 'stage') }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
CR_REGISTRY: crp8vh46gd976oq8ipla
|
CR_REGISTRY: crp8vh46gd976oq8ipla
|
||||||
@@ -47,6 +59,10 @@ jobs:
|
|||||||
environment: ${{ inputs.environment }}
|
environment: ${{ inputs.environment }}
|
||||||
tag: ${{ inputs.tag }}
|
tag: ${{ inputs.tag }}
|
||||||
migrate: ${{ inputs.migrate }}
|
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
|
- name: post-notify
|
||||||
if: always()
|
if: always()
|
||||||
uses: https://bb.hublab.ru/HUB/workflows/.gitea/actions/vk-notify@main
|
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 }}
|
VK_TEAMS_CHAT_ID: ${{ secrets.VK_TEAMS_CHAT_ID }}
|
||||||
with:
|
with:
|
||||||
result: ${{ steps.k8s_deploy.outcome }}
|
result: ${{ steps.k8s_deploy.outcome }}
|
||||||
name: k8s deploy ${{ inputs.environment }} tag ${{ inputs.tag }}
|
name: deploy ${{ inputs.environment }} tag ${{ inputs.tag }}
|
||||||
|
|||||||
Reference in New Issue
Block a user