-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
166 changed files
with
5,099 additions
and
1,949 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,122 @@ | ||
name: Build docker image | ||
name: Build and Push Docker Images | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
name: | ||
description: "Manual workflow name" | ||
required: true | ||
|
||
push: | ||
tags: | ||
- v* | ||
|
||
env: | ||
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }} | ||
IMAGE_NAME: getconvoy/convoy | ||
RELEASE_VERSION: ${{ github.ref_name }} | ||
|
||
jobs: | ||
deploy: | ||
runs-on: "ubuntu-latest" | ||
build_ui: | ||
name: Build UI | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Build Artifact | ||
run: "make ui_install type=ce" | ||
|
||
- name: Archive Build artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: dist-without-markdown | ||
path: | | ||
web/ui/dashboard/dist | ||
!web/ui/dashboard/dist/**/*.md | ||
build-and-push-arch: | ||
runs-on: ubuntu-latest | ||
needs: [build_ui] | ||
strategy: | ||
matrix: | ||
include: | ||
- arch: amd64 | ||
platform: linux/amd64 | ||
dockerfile: release.Dockerfile | ||
- arch: arm64 | ||
platform: linux/arm64 | ||
dockerfile: release.Dockerfile | ||
|
||
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 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.21 | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Get and verify dependencies | ||
run: go mod tidy && go mod download && go mod verify | ||
|
||
- name: Get the version | ||
id: get_version | ||
run: echo ::set-output name=tag::$(cat VERSION) | ||
- name: Go vet | ||
run: go vet ./... | ||
|
||
- name: Authenticate | ||
uses: actions-hub/docker/login@master | ||
env: | ||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | ||
DOCKER_PASSWORD: ${{ secrets.PAT }} | ||
DOCKER_REGISTRY_URL: ghcr.io | ||
- name: Build app to make sure there are zero issues | ||
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 | ||
|
||
- 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 arch specific images | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
file: ${{ matrix.dockerfile }} | ||
platforms: ${{ matrix.platform }} | ||
push: true | ||
tags: | | ||
${{ env.IMAGE_NAME }}:${{ env.RELEASE_VERSION }}-${{ matrix.arch }} | ||
build-args: | | ||
ARCH=${{ matrix.arch }} | ||
build-and-push-default: | ||
runs-on: ubuntu-latest | ||
needs: [build-and-push-arch] | ||
steps: | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ env.DOCKER_HUB_USERNAME }} | ||
password: ${{ env.DOCKER_HUB_TOKEN }} | ||
|
||
- name: Build latest image | ||
run: docker build -t ghcr.io/${GITHUB_REPOSITORY}:${{ steps.get_version.outputs.tag }} . | ||
- 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: Push | ||
uses: actions-hub/docker@master | ||
with: | ||
args: push ghcr.io/${GITHUB_REPOSITORY}:${{ steps.get_version.outputs.tag }} | ||
- 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 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.