Skip to content

Commit

Permalink
Fix docker manifest (#2136)
Browse files Browse the repository at this point in the history
* chore: fix manifest

* chore: fix manifest arch

* chore: use multiple tags

* chore: build manifest separately

* chore: print api/ui/build contents

* chore: remove print api/ui/build contents
  • Loading branch information
jirevwe authored Sep 2, 2024
1 parent 9354c24 commit 365c60f
Showing 1 changed file with 21 additions and 51 deletions.
72 changes: 21 additions & 51 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ on:
required: true
push:
tags:
# Release binary for every tag.
- v*

env:
Expand Down Expand Up @@ -49,29 +48,32 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Download Build Artifact
uses: actions/download-artifact@v4
with:
name: dist-without-markdown
path: api/ui/build
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.21

- name: Check out code
uses: actions/checkout@v4

- name: Get and verify dependencies
run: go mod tidy && go mod download && go mod verify

- name: Go vet
run: go vet ./...

- name: Build app to make sure there are zero issues
run: go build -o convoy ./cmd
run: |
export CGO_ENABLED=0
export GOOS=linux
export GOARCH=${{ matrix.arch }}
go build -o convoy ./cmd
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
Expand All @@ -86,7 +88,7 @@ jobs:
password: ${{ env.DOCKER_HUB_TOKEN }}

- name: Build and push arch specific images
uses: docker/build-push-action@v2
uses: docker/build-push-action@v6
with:
context: .
file: ${{ matrix.dockerfile }}
Expand All @@ -97,56 +99,24 @@ jobs:
build-args: |
ARCH=${{ matrix.arch }}
build-and-push-default:
runs-on: ubuntu-latest
needs: [build_ui]
needs: [build-and-push-arch]
steps:
- uses: actions/checkout@v4

- name: Download Build Artifact
uses: actions/download-artifact@v4
with:
name: dist-without-markdown
path: api/ui/build
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.21

- name: Check out code
uses: actions/checkout@v4

- name: Get and verify dependencies
run: go mod tidy && go mod download && go mod verify

- name: Go vet
run: go vet ./...

- name: Build app to make sure there are zero issues
run: go build -o convoy ./cmd

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ env.DOCKER_HUB_USERNAME }}
password: ${{ env.DOCKER_HUB_TOKEN }}

- name: Build and push default image
uses: docker/build-push-action@v2
with:
context: .
file: release.Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ env.IMAGE_NAME }}:${{ env.RELEASE_VERSION }}
${{ env.IMAGE_NAME }}:latest
- name: Create and push manifest for latest
run: |
docker buildx imagetools create -t ${{ env.IMAGE_NAME }}:latest \
${{ env.IMAGE_NAME }}:${{ env.RELEASE_VERSION }}-amd64 \
${{ env.IMAGE_NAME }}:${{ env.RELEASE_VERSION }}-arm64
- name: Create and push manifest for version
run: |
docker buildx imagetools create -t ${{ env.IMAGE_NAME }}:${{ env.RELEASE_VERSION }} \
${{ env.IMAGE_NAME }}:${{ env.RELEASE_VERSION }}-amd64 \
${{ env.IMAGE_NAME }}:${{ env.RELEASE_VERSION }}-arm64

0 comments on commit 365c60f

Please sign in to comment.