diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 84aa007..66c265d 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -47,46 +47,46 @@ jobs: - name: Test run: go test -race ./... - # - name: Set up QEMU - # uses: docker/setup-qemu-action@v3 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 - # - name: Set up Docker Buildx - # uses: docker/setup-buildx-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - # - name: Login to GitHub Container Registry - # uses: docker/login-action@v2 - # with: - # registry: ghcr.io - # username: ${{ github.actor }} - # password: ${{ secrets.GITHUB_TOKEN }} + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - # - name: Build and push PR - # if: ${{ github.event_name == 'pull_request' }} - # uses: docker/build-push-action@v5 - # with: - # context: . - # platforms: linux/arm64,linux/amd64 - # file: ./Dockerfile - # push: true - # tags: ghcr.io/castai/gpu-metrics-exporter/gpu-metrics-exporter:${{ github.sha }} + - name: Build and push PR + if: ${{ github.event_name == 'pull_request' }} + uses: docker/build-push-action@v5 + with: + context: . + platforms: linux/arm64,linux/amd64 + file: ./Dockerfile + push: true + tags: ghcr.io/castai/gpu-metrics-exporter/gpu-metrics-exporter:${{ github.sha }} - # - name: Build and push main - # if: ${{ github.event_name != 'pull_request' && github.event_name != 'release' }} - # uses: docker/build-push-action@v5 - # with: - # context: . - # platforms: linux/arm64,linux/amd64 - # file: ./Dockerfile - # push: true - # tags: ghcr.io/castai/egressd/egressd:${{ github.sha }} + - name: Build and push main + if: ${{ github.event_name != 'pull_request' && github.event_name != 'release' }} + uses: docker/build-push-action@v5 + with: + context: . + platforms: linux/arm64,linux/amd64 + file: ./Dockerfile + push: true + tags: ghcr.io/castai/gpu-metrics-exporter/gpu-metrics-exporter:${{ github.sha }} - # - name: Build and push release (egressd collector) - # uses: docker/build-push-action@v5 - # with: - # context: . - # push: true - # platforms: linux/arm64,linux/amd64 - # file: ./Dockerfile - # tags: | - # ghcr.io/castai/gpu-metrics-exporter/gpu-metrics-exporter:${{ env.RELEASE_TAG }} - # ghcr.io/castai/gpu-metrics-exporter/gpu-metrics-exporter:latest \ No newline at end of file + - name: Build and push release + uses: docker/build-push-action@v5 + with: + context: . + push: true + platforms: linux/arm64,linux/amd64 + file: ./Dockerfile + tags: | + ghcr.io/castai/gpu-metrics-exporter/gpu-metrics-exporter:${{ env.RELEASE_TAG }} + ghcr.io/castai/gpu-metrics-exporter/gpu-metrics-exporter:latest \ No newline at end of file