Skip to content

Commit

Permalink
add build and publish step in pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
sindunuragarp committed Nov 6, 2023
1 parent c20da12 commit e756127
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/go.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,46 @@ jobs:
- name: Run go tests
run: |
go test -short `go list ./... | grep -v ./test_e2e_arc`
build:
needs: [fmt, lint, generate, test]
runs-on: ubuntu-latest
env:
REGISTRY_IMAGE: ghcr.io/miroapp/actions-runner-controller
BUILD_PLATFORM: linux/amd64
BUILD_VERSION: ${{ github.sha }}-${{ github.run_number }}
steps:
- uses: docker/setup-buildx-action@v3

- uses: docker/login-action@v3
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io

- uses: docker/setup-qemu-action@v3
with:
image: tonistiigi/binfmt:latest
platforms: ${{ env.BUILD_PLATFORM }}

- id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY_IMAGE }}

- uses: docker/build-push-action@v5
id: build
with:
build-args: |
VERSION=${{ env.BUILD_VERSION }}
TARGETPLATFORM=${{ env.BUILD_PLATFORM }}
TARGETOS=linux
TARGETARCH=amd64
cache-from: |
type=gha,scope=${{ github.event.repository.default_branch }}
type=gha,scope=${{ github.ref_name }}
cache-to: type=gha,mode=max,scope=${{ github.ref_name }}
platforms: ${{ env.BUILD_PLATFORM }}
labels: ${{ steps.meta.outputs.labels }}
push: true
tags: ${{ env.REGISTRY_IMAGE }}:${{ env.BUILD_VERSION }}

0 comments on commit e756127

Please sign in to comment.