From 29a137499e0d333758bf6781c1a27f1a7b818bca Mon Sep 17 00:00:00 2001 From: Alex Shevchuk Date: Tue, 19 Aug 2025 20:48:07 +0300 Subject: [PATCH] =?UTF-8?q?53=20=D1=8D=D1=82=D0=BE=20=D0=A1=D0=B0=D0=BD?= =?UTF-8?q?=D0=BA=D1=82=20=D0=9F=D0=B5=D1=82=D0=B5=D1=80=D0=B1=D1=83=D1=80?= =?UTF-8?q?=D0=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/deploy_staging.yaml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/deploy_staging.yaml b/.gitea/workflows/deploy_staging.yaml index bcedb55..8593a02 100644 --- a/.gitea/workflows/deploy_staging.yaml +++ b/.gitea/workflows/deploy_staging.yaml @@ -48,10 +48,9 @@ jobs: needs: git-metadata env: IMAGE_NAME: molvaapp/test_deploy + IMAGE_TAG: ${{ inputs.environment }}-${{ steps.git-metadata.outputs.GIT_TAG != 'none' && steps.git-metadata.outputs.GIT_TAG || steps.git-metadata.outputs.GIT_SHA }} CONFIG_FILE: .build/config/staging.yaml run: | - IMAGE_TAG=${{ inputs.environment }}-${{ steps.git-metadata.outputs.GIT_TAG != 'none' && steps.git-metadata.outputs.GIT_TAG || steps.git-metadata.outputs.GIT_SHA }} - docker build \ --build-arg BUILD_LDFLAGS="-w -s" \ --build-arg CONFIG_FILE_PATH=$CONFIG_FILE \ @@ -81,6 +80,9 @@ jobs: - name: Deploy to Swarm env: + REGISTRY: hub.docker.com + REPO: ${{ github.repository }} + DOCKER_HOST: tcp://${{ secrets.SWARM_MANAGER_HOST }}:2376 DOCKER_TLS_VERIFY: 1 DOCKER_CERT_PATH: /tmp/swarm-certs @@ -88,7 +90,6 @@ jobs: VERSION: ${{ inputs.version == 'new' && 'latest' || inputs.version }} APP_COMMIT: ${{ steps.git-metadata.outputs.GIT_TAG != 'none' && steps.git-metadata.outputs.GIT_TAG || steps.git-metadata.outputs.GIT_SHA }} - APP_BUILD_DATE: ${{ date +"%Y-%m-%d %T %Z" }} KEYCLOAK_BASE_URL: ${{ secrets.KEYCLOAK_BASE_URL }} KEYCLOAK_REALM: ${{ secrets.KEYCLOAK_REALM }} @@ -113,6 +114,11 @@ jobs: INTEGRATION_VKUSVILL_API_TOKEN: ${{ secrets.INTEGRATION_VKUSVILL_API_TOKEN }} run: | + REPO_NAME=$(echo $REPO | cut -d'/' -f2) + + export APP_BUILD_DATE=$(wget -q -O - "https://$REGISTRY/v2/namespaces/molvaapp/repositories/$REPO_NAME/tags?page_size=100" | jq -r '.results[] | select(.name == $VERSION) | .tag_last_pushed') + echo "APP_BUILD_DATE=$APP_BUILD_DATE" + envsubst < docker-compose.staging.yaml > docker-compose.runtime.yaml echo "Deploying version $VERSION to ${{ inputs.environment }}..."