From ffcb515fa2ccde2f0dc57524040647954595d714 Mon Sep 17 00:00:00 2001 From: Nikita Andriyanov Date: Sat, 12 Apr 2025 14:35:47 +0300 Subject: [PATCH] add k8s --- .github/workflows/deployk8s.yaml | 62 ++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/workflows/deployk8s.yaml diff --git a/.github/workflows/deployk8s.yaml b/.github/workflows/deployk8s.yaml new file mode 100644 index 0000000..2b4906e --- /dev/null +++ b/.github/workflows/deployk8s.yaml @@ -0,0 +1,62 @@ +on: + workflow_call: + inputs: + tag: + required: false + type: string + default: latest + debug: + required: false + type: boolean + default: false + migrate: + type: boolean + default: false + build: + type: boolean + default: false + environment: + type: string + required: true + host: + type: string + required: true + +jobs: + prenotify: + uses: HUB/workflows/.github/workflows/notify.yaml@main + with: + result: 'started' + name: k8s deploy ${{ inputs.environment }} tag ${{ inputs.tag }} + secrets: inherit + deploy: + runs-on: ubuntu-latest + env: + CR_REGISTRY: crp8vh46gd976oq8ipla + CR_REPO: ${{ github.event.repository.name }} + TAG: ${{ inputs.tag }} + 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 ${{ 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: Sync changes + uses: clowdhaus/argo-cd-action/@main + with: + version: 2.13.3 + command: app sync ${{ inputs.environment }} + notify: + needs: [deploy] + if: always() + uses: HUB/workflows/.github/workflows/notify.yaml@main + with: + result: ${{ needs.deploy.result}} + name: k8s deploy ${{ inputs.environment }} tag ${{ inputs.tag }} + secrets: inherit \ No newline at end of file