Repository navigation
130 lines (111 loc) · 4.06 KB
/
Copy pathbuild-dev-image.yml
File metadata and controls
130 lines (111 loc) · 4.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: Build and Push Dev Docker Images
permissions:
contents: read
on:
workflow_dispatch:
inputs:
name:
description: "Tag to identify development Docker imag"
required: true
push:
tags:
- dev-*
env:
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }}
IMAGE_NAME: getconvoy/convoy
DEV_VERSION: ${{ github.ref_name }}
jobs:
build_ui:
name: Build UI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: '24'
- name: Build Artifact
run: "make ui_install type=ce"
- name: Archive Build artifacts
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: dist-without-markdown-dev
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@08c6903cd8c0fde910a37f88322edcfb5dd907a8
with:
fetch-depth: 0
- name: Download Build Artifact
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0
with:
name: dist-without-markdown-dev
path: api/ui/build
- name: Set up Go
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00
with:
go-version: 1.26.2
- 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: |
export CGO_ENABLED=0
export GOOS=linux
export GOARCH=${{ matrix.arch }}
go build -ldflags="-X github.com/frain-dev/convoy.Version=${{ env.DEV_VERSION }}" -o convoy ./cmd
- name: Set up QEMU
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435
- name: Login to Docker Hub
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef
with:
username: ${{ env.DOCKER_HUB_USERNAME }}
password: ${{ env.DOCKER_HUB_TOKEN }}
- name: Build and push arch specific dev images
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83
with:
context: .
file: ${{ matrix.dockerfile }}
platforms: ${{ matrix.platform }}
push: true
tags: |
${{ env.IMAGE_NAME }}:${{ env.DEV_VERSION }}-${{ matrix.arch }}
${{ env.IMAGE_NAME }}:dev-latest-${{ 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@5e57cd118135c172c3672efd75eb46360885c0ef
with:
username: ${{ env.DOCKER_HUB_USERNAME }}
password: ${{ env.DOCKER_HUB_TOKEN }}
- name: Create and push manifest for dev-latest
run: |
docker buildx imagetools create -t ${{ env.IMAGE_NAME }}:dev-latest \
${{ env.IMAGE_NAME }}:dev-latest-amd64 \
${{ env.IMAGE_NAME }}:dev-latest-arm64
- name: Create and push manifest for dev version
run: |
docker buildx imagetools create -t ${{ env.IMAGE_NAME }}:${{ env.DEV_VERSION }} \
${{ env.IMAGE_NAME }}:${{ env.DEV_VERSION }}-amd64 \
${{ env.IMAGE_NAME }}:${{ env.DEV_VERSION }}-arm64