From df3fc0c5e6e75542a7b0bc2d0b71bae08df7adf7 Mon Sep 17 00:00:00 2001 From: Anne Schuth Date: Fri, 23 Jan 2026 10:39:07 +0100 Subject: [PATCH] feat: migrate deployment to zad-actions Replace GitOps-based deployment with direct API-based deployment using RijksICTGilde/zad-actions. Changes: - Remove ai-validation-infra repository checkout and sed commands - Use zad-actions/deploy action for direct deployment - Map to tr-dev ZAD project with 'main' deployment --- .github/workflows/deploy.yml | 58 ++++++++++++++---------------------- 1 file changed, 22 insertions(+), 36 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 65ccd3d..9975fb4 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,4 +1,4 @@ -name: Generate and Deploy Index +name: Deploy on: workflow_dispatch: @@ -8,9 +8,14 @@ on: required: true default: "main" +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + env: - POETRY_CACHE_DIR: ~/.cache/pypoetry - PIPX_BIN_DIR: /usr/local/bin + ZAD_PROJECT: tr-dev + ZAD_DEPLOYMENT: main + ZAD_COMPONENT: component-1 jobs: deploy: @@ -19,42 +24,23 @@ jobs: - name: Get GHCR package hash id: get_package_hash run: | - container_id=$(gh api --paginate -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /orgs/MinBZK/packages/container/task-registry/versions | jq -r '.[] | select(.metadata.container.tags | contains(["${{ inputs.image_tag }}"])) | .name') - echo "container_id=$container_id" >> "$GITHUB_OUTPUT" + container_id=$(gh api --paginate -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /orgs/MinBZK/packages/container/task-registry/versions | jq -r '.[] | select(.metadata.container.tags | contains(["${{ inputs.image_tag }}"])) | .name') + echo "container_id=$container_id" >> "$GITHUB_OUTPUT" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: check correct name + - name: Check container exists run: | - if [ -z "${{steps.get_package_hash.outputs.container_id}}" ]; then - echo "Variable is empty. Failing the workflow." - exit 1 - fi + if [ -z "${{ steps.get_package_hash.outputs.container_id }}" ]; then + echo "Container tag '${{ inputs.image_tag }}' not found. Failing the workflow." + exit 1 + fi - - uses: actions/checkout@v5 + - name: Deploy to ZAD + uses: RijksICTGilde/zad-actions/deploy@v1 with: - repository: 'minbzk/ai-validation-infra' - ref: main - token: ${{ secrets.GH_PAT }} - - - name: Configure Git - run: | - git config --global user.name "github-actions[bot]" - git config --global user.email "github-actions[bot]@users.noreply.github.com" - - - - name: Make changes to the file - run: | - sed -i 's/newTag: .*$/newTag: ${{inputs.image_tag }}@${{ steps.get_package_hash.outputs.container_id }}/g' apps/task-registry/sandbox/kustomization.yaml - sed -i 's|minbzk.github.io/version: .*$|minbzk.github.io/version: main|g' apps/task-registry/sandbox/kustomization.yaml - git add apps/task-registry/sandbox/kustomization.yaml - - - name: show changes - run: git diff --staged - - - name: push changes - run: | - git commit -m "Update task-registry sandbox tag ${{ steps.get_package_hash.outputs.container_id }}" - git push --force-with-lease - env: - GITHUB_TOKEN: ${{ secrets.GH_PAT }} + api-key: ${{ secrets.ZAD_API_KEY }} + project-id: ${{ env.ZAD_PROJECT }} + deployment-name: ${{ env.ZAD_DEPLOYMENT }} + component: ${{ env.ZAD_COMPONENT }} + image: ghcr.io/minbzk/task-registry:${{ inputs.image_tag }}@${{ steps.get_package_hash.outputs.container_id }}