name: Dokploy Monitoring Build on: push: branches: [main, canary] env: IMAGE_NAME: dokploy/monitoring permissions: contents: read jobs: docker-amd: runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v7 with: persist-credentials: false - name: Set up Docker Buildx uses: docker/setup-buildx-action@v4 - name: Login to Docker Hub uses: docker/login-action@v4 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Set tag id: meta run: | if [ "$GITHUB_REF" = "refs/heads/main" ]; then TAG="latest" elif [ "$GITHUB_REF" = "refs/heads/canary" ]; then TAG="canary" else TAG="feature" fi echo "tags=${IMAGE_NAME}:${TAG}-amd64" >> "$GITHUB_OUTPUT" - name: Build and push uses: docker/build-push-action@v7 with: context: . file: ./Dockerfile.monitoring platforms: linux/amd64 push: true tags: ${{ steps.meta.outputs.tags }} docker-arm: runs-on: ubuntu-24.04-arm steps: - name: Checkout uses: actions/checkout@v7 with: persist-credentials: false - name: Set up Docker Buildx uses: docker/setup-buildx-action@v4 - name: Login to Docker Hub uses: docker/login-action@v4 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Set id: meta run: | if [ "$GITHUB_REF" = "refs/heads/main" ]; then TAG="latest" elif [ "$GITHUB_REF" = "refs/heads/canary" ]; then TAG="canary" else TAG="feature" fi echo "tags=${IMAGE_NAME}:${TAG}-arm64" >> "$GITHUB_OUTPUT" - name: Build and push uses: docker/build-push-action@v7 with: context: . file: ./Dockerfile.monitoring platforms: linux/arm64 push: true tags: ${{ steps.meta.outputs.tags }} combine-manifests: needs: [docker-amd, docker-arm] runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v7 with: persist-credentials: false - name: Set up Docker Buildx uses: docker/setup-buildx-action@v4 - name: Login to Docker Hub uses: docker/login-action@v4 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Create and push manifests run: | if [ "$GITHUB_REF" = "refs/heads/main" ]; then TAG="latest" docker buildx imagetools create -t ${IMAGE_NAME}:${TAG} \ ${IMAGE_NAME}:${TAG}-amd64 \ ${IMAGE_NAME}:${TAG}-arm64 elif [ "$GITHUB_REF" = "refs/heads/canary" ]; then TAG="canary" docker buildx imagetools create -t ${IMAGE_NAME}:${TAG} \ ${IMAGE_NAME}:${TAG}-amd64 \ ${IMAGE_NAME}:${TAG}-arm64 else TAG="feature" docker buildx imagetools create -t ${IMAGE_NAME}:${TAG} \ ${IMAGE_NAME}:${TAG}-amd64 \ ${IMAGE_NAME}:${TAG}-arm64 fi