name: Beta Docker Build on: push: branches: - beta jobs: docker: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 with: fetch-depth: 0 - name: Calculate beta version id: calculate_version run: | # Get the latest tag LATEST_TAG=$(git tag | grep -v 'beta' | sort -V | tail -n1) echo "Found latest tag: ${LATEST_TAG}" # Split the version IFS='.' read -r -a VERSION_PARTS <<< "$LATEST_TAG" MAJOR="${VERSION_PARTS[0]}" MINOR="${VERSION_PARTS[1]}" PATCH="${VERSION_PARTS[2]}" # Increment patch version NEW_PATCH=$((PATCH + 1)) BETA_VERSION="${MAJOR}.${MINOR}.${NEW_PATCH}" echo "Calculated beta version: ${BETA_VERSION}" echo "beta_version=${BETA_VERSION}" >> $GITHUB_ENV - name: Set up QEMU uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Login to Docker Hub uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push beta Docker image uses: docker/build-push-action@v5 with: context: . platforms: linux/amd64,linux/arm64,linux/arm/v7 push: true tags: cy01/blackhole:beta build-args: | VERSION=${{ env.beta_version }} CHANNEL=beta