From 0f83855e85a38f174474033a553281c3ae977230 Mon Sep 17 00:00:00 2001 From: Zeecka Date: Sun, 18 Jan 2026 14:36:34 +0100 Subject: [PATCH] release.yml --- .github/workflows/release.yml | 62 +++-------------------------------- 1 file changed, 4 insertions(+), 58 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6812636..e39959d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,17 +13,6 @@ jobs: - name: Get release version run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV - - name: Determine tag type (prod vs main) - id: tag_type - run: | - if [[ "${{ env.RELEASE_VERSION }}" == *"-prod"* ]]; then - echo "is_prod_tag=true" >> $GITHUB_OUTPUT - echo "📦 Prod tag detected - will push :latest-prod" - else - echo "is_prod_tag=false" >> $GITHUB_OUTPUT - echo "📦 Main tag detected - will push :latest" - fi - - name: Checkout uses: actions/checkout@v4 @@ -40,20 +29,8 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - # Build and push for PROD tags (X.X.X-prod) - - name: Build and push Docker images (prod) - if: steps.tag_type.outputs.is_prod_tag == 'true' - uses: docker/build-push-action@v6.9.0 - with: - context: ./ - push: true - tags: | - ghcr.io/zeecka/aperisolve:${{ env.RELEASE_VERSION }} - ghcr.io/zeecka/aperisolve:prod - # Build and push for MAIN tags (X.X.X) - - name: Build and push Docker images (main) - if: steps.tag_type.outputs.is_prod_tag == 'false' + - name: Build and push Docker images uses: docker/build-push-action@v6.9.0 with: context: ./ @@ -73,39 +50,6 @@ jobs: with: fetch-depth: 0 - - name: Check if tag is from prod branch - id: check - run: | - TAG_REF="${GITHUB_REF#refs/tags/}" - echo "Tag: $TAG_REF" - echo "Commit SHA: $GITHUB_SHA" - - # Get branches containing this commit - BRANCHES=$(git branch -r --contains HEAD) - echo "Branches containing this commit: $BRANCHES" - - # Check if commit is on prod branch - if echo "$BRANCHES" | grep -q "origin/prod"; then - # Additional check: ensure this commit is at the HEAD of prod - # This prevents deployment if the same commit exists on multiple branches - PROD_HEAD=$(git rev-parse origin/prod) - TAG_COMMIT=$(git rev-parse HEAD) - - echo "Prod HEAD: $PROD_HEAD" - echo "Tag commit: $TAG_COMMIT" - - if [ "$PROD_HEAD" = "$TAG_COMMIT" ]; then - echo "is_prod=true" >> $GITHUB_OUTPUT - echo "✅ Tag is at prod branch HEAD - will deploy" - else - echo "is_prod=false" >> $GITHUB_OUTPUT - echo "⚠️ Commit is on prod but not at HEAD - skipping deployment" - fi - else - echo "is_prod=false" >> $GITHUB_OUTPUT - echo "❌ Tag is not from prod branch - skipping deployment" - fi - # wait for 120 seconds - name: Wait for image propagation if: steps.check.outputs.is_prod == 'true' @@ -114,7 +58,6 @@ jobs: sleep 120 - name: Deploy to production server - if: steps.check.outputs.is_prod == 'true' uses: appleboy/ssh-action@v1.0.3 with: host: ${{ secrets.PROD_SSH_HOST }} @@ -138,6 +81,9 @@ jobs: SKIP_IHDR_FILL=${{ vars.SKIP_IHDR_FILL }} REMOVAL_MIN_AGE_SECONDS=${{ vars.REMOVAL_MIN_AGE_SECONDS }} + GOOGLE_ADS_TXT=${{ vars.GOOGLE_ADS_TXT }} + CUSTOM_EXTERNAL_SCRIPT=${{ vars.CUSTOM_EXTERNAL_SCRIPT }} + FLASK_DEBUG=${{ vars.FLASK_DEBUG }} RQ_DASHBOARD_REDIS_URL=${{ vars.RQ_DASHBOARD_REDIS_URL }}