--- # dance-lessons-coach Docker Push Workflow # Separate workflow for Docker image building and pushing # Can be triggered manually or by CI/CD workflow name: Docker Push on: # Manual trigger for testing or production workflow_dispatch: inputs: ref: description: 'Git reference (branch/tag)' required: false type: string default: '' # Environment variables env: GITEA_INTERNAL: "https://gitea.arcodange.lab/" GITEA_EXTERNAL: "https://gitea.arcodange.fr/" GITEA_ORG: "arcodange" GITEA_REPO: "dance-lessons-coach" CI_REGISTRY: "gitea.arcodange.lab" jobs: docker-push: name: Docker Push runs-on: ubuntu-latest-ca steps: - name: Checkout code uses: actions/checkout@v4 with: ref: ${{ github.event.inputs.ref || github.ref }} - name: Login to Gitea Container Registry uses: docker/login-action@v3 with: registry: ${{ env.CI_REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.PACKAGES_TOKEN }} - name: Calculate dependency hash id: calc_hash run: | # Calculate dependency hash (same method as build-cache job) DEPS_HASH=$(sha256sum go.mod go.sum docker/Dockerfile.build | sha256sum | cut -d' ' -f1 | head -c 12) echo "Dependency hash: $DEPS_HASH" echo "deps_hash=$DEPS_HASH" >> $GITHUB_OUTPUT - name: Build and push Docker image run: | source VERSION IMAGE_VERSION="$MAJOR.$MINOR.$PATCH${PRERELEASE:+-$PRERELEASE}" # Use the calculated dependency hash and export it DEPS_HASH="${{ steps.calc_hash.outputs.deps_hash }}" echo "Using dependency hash: $DEPS_HASH" export DEPS_HASH TAGS="$IMAGE_VERSION latest ${{ github.sha }}" echo "Building Docker image with tags: $TAGS" # Build the production image using inline version with prebuilt cache image # Fixed: Use proper variable substitution in the inline Dockerfile docker build -t dance-lessons-coach -f - . <