Skip to content

Commit

Permalink
Merge pull request #3 from castai/chore/enable-docker-build
Browse files Browse the repository at this point in the history
Enable docker build and release
  • Loading branch information
Ivaka authored Mar 14, 2024
2 parents eba64ab + 5d33154 commit 0e167c6
Showing 1 changed file with 39 additions and 38 deletions.
77 changes: 39 additions & 38 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,46 +47,47 @@ 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
- name: Build and push release
if: ${{ github.event_name == '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

0 comments on commit 0e167c6

Please sign in to comment.