From 490537007bd1204076d950ab45413ee7e4f8e758 Mon Sep 17 00:00:00 2001 From: ardi Date: Thu, 9 Oct 2025 09:25:17 +0000 Subject: [PATCH] Update .gitea/workflows/build.yml --- .gitea/workflows/build.yml | 38 +++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index ec01f2f..3558ed5 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -30,14 +30,6 @@ jobs: id: output run: | echo "${{ steps.generator.outputs.docker }}" > Dockerfile - echo "${{ steps.generator.outputs.k8s }}" > k8s.yml - - - name: "Replace APP_NAME" - run: | - NAME=$(echo "$IMAGE_NAME" | sed 's/\//-/g') - sed -i "s|APP_NAME|$NAME|g" k8s.yml - sed -i "s|IMAGE_NAME|$REGISTRY/$IMAGE_NAME:$IMAGE_TAG|g" k8s.yml - cat k8s.yml - name: "Create buildkitd.toml" run: | @@ -68,4 +60,32 @@ jobs: - name: "Cleanup builder" if: always() run: docker buildx rm $BUILDER_NAME || true - \ No newline at end of file + + - name: Set image name + id: export + run: | + echo "image=$REGISTRY/$IMAGE_NAME:$IMAGE_TAG" >> $GITEA_OUTPUT + + outputs: + image: ${{ steps.export.outputs.image }} + + deploy: + runs-on: k8s-runner-00 + needs: build + env: + IMAGE_NAME: ${{ gitea.repository }} + DIGEST_IMAGE: ${{ needs.build.outputs.image }} + steps: + - name: "Checkout repository" + uses: actions/checkout@v4 + + - name: "Generate Dockerfile" + run: curl -o k8s.yml https://n8n.mceasy.cloud/webhook/generator/manifest?type=k8s + + - name: "Replace APP_NAME" + run: | + NAME=$(echo "$IMAGE_NAME" | sed 's/\//-/g') + sed -i "s|APP_NAME|$NAME|g" k8s.yml + sed -i "s|IMAGE_NAME|$DIGEST_IMAGE|g" k8s.yml + cat k8s.yml + \ No newline at end of file