|
| 1 | +name: Build and Push Dev Docker Images |
| 2 | + |
| 3 | +permissions: |
| 4 | + contents: read |
| 5 | + |
| 6 | +on: |
| 7 | + workflow_dispatch: |
| 8 | + inputs: |
| 9 | + name: |
| 10 | + description: "Tag to identify development Docker imag" |
| 11 | + required: true |
| 12 | + push: |
| 13 | + tags: |
| 14 | + - dev-* |
| 15 | + |
| 16 | +env: |
| 17 | + DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }} |
| 18 | + DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }} |
| 19 | + IMAGE_NAME: getconvoy/convoy |
| 20 | + DEV_VERSION: ${{ github.ref_name }} |
| 21 | + |
| 22 | +jobs: |
| 23 | + build_ui: |
| 24 | + name: Build UI |
| 25 | + runs-on: ubuntu-latest |
| 26 | + steps: |
| 27 | + - uses: actions/checkout@v08c6903cd8c0fde910a37f88322edcfb5dd907a8 |
| 28 | + - name: Build Artifact |
| 29 | + run: "make ui_install type=ce" |
| 30 | + |
| 31 | + - name: Archive Build artifacts |
| 32 | + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 |
| 33 | + with: |
| 34 | + name: dist-without-markdown-dev |
| 35 | + path: | |
| 36 | + web/ui/dashboard/dist |
| 37 | + !web/ui/dashboard/dist/**/*.md |
| 38 | +
|
| 39 | + build-and-push-arch: |
| 40 | + runs-on: ubuntu-latest |
| 41 | + needs: [build_ui] |
| 42 | + strategy: |
| 43 | + matrix: |
| 44 | + include: |
| 45 | + - arch: amd64 |
| 46 | + platform: linux/amd64 |
| 47 | + dockerfile: release.Dockerfile |
| 48 | + - arch: arm64 |
| 49 | + platform: linux/arm64 |
| 50 | + dockerfile: release.Dockerfile |
| 51 | + |
| 52 | + steps: |
| 53 | + - uses: actions/checkout@v08c6903cd8c0fde910a37f88322edcfb5dd907a8 |
| 54 | + with: |
| 55 | + fetch-depth: 0 |
| 56 | + |
| 57 | + - name: Download Build Artifact |
| 58 | + uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 |
| 59 | + with: |
| 60 | + name: dist-without-markdown-dev |
| 61 | + path: api/ui/build |
| 62 | + |
| 63 | + - name: Set up Go |
| 64 | + uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 |
| 65 | + with: |
| 66 | + go-version: 1.24 |
| 67 | + |
| 68 | + - name: Get and verify dependencies |
| 69 | + run: go mod tidy && go mod download && go mod verify |
| 70 | + |
| 71 | + - name: Go vet |
| 72 | + run: go vet ./... |
| 73 | + |
| 74 | + - name: Build app to make sure there are zero issues |
| 75 | + run: | |
| 76 | + export CGO_ENABLED=0 |
| 77 | + export GOOS=linux |
| 78 | + export GOARCH=${{ matrix.arch }} |
| 79 | + go build -o convoy ./cmd |
| 80 | +
|
| 81 | + - name: Set up QEMU |
| 82 | + uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 |
| 83 | + |
| 84 | + - name: Set up Docker Buildx |
| 85 | + uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 |
| 86 | + |
| 87 | + - name: Login to Docker Hub |
| 88 | + uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef |
| 89 | + with: |
| 90 | + username: ${{ env.DOCKER_HUB_USERNAME }} |
| 91 | + password: ${{ env.DOCKER_HUB_TOKEN }} |
| 92 | + |
| 93 | + - name: Build and push arch specific dev images |
| 94 | + uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 |
| 95 | + with: |
| 96 | + context: . |
| 97 | + file: ${{ matrix.dockerfile }} |
| 98 | + platforms: ${{ matrix.platform }} |
| 99 | + push: true |
| 100 | + tags: | |
| 101 | + ${{ env.IMAGE_NAME }}:${{ env.DEV_VERSION }}-${{ matrix.arch }} |
| 102 | + ${{ env.IMAGE_NAME }}:dev-latest-${{ matrix.arch }} |
| 103 | + build-args: | |
| 104 | + ARCH=${{ matrix.arch }} |
| 105 | +
|
| 106 | + build-and-push-default: |
| 107 | + runs-on: ubuntu-latest |
| 108 | + needs: [build-and-push-arch] |
| 109 | + steps: |
| 110 | + - name: Login to Docker Hub |
| 111 | + uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef |
| 112 | + with: |
| 113 | + username: ${{ env.DOCKER_HUB_USERNAME }} |
| 114 | + password: ${{ env.DOCKER_HUB_TOKEN }} |
| 115 | + |
| 116 | + - name: Create and push manifest for dev-latest |
| 117 | + run: | |
| 118 | + docker buildx imagetools create -t ${{ env.IMAGE_NAME }}:dev-latest \ |
| 119 | + ${{ env.IMAGE_NAME }}:dev-latest-amd64 \ |
| 120 | + ${{ env.IMAGE_NAME }}:dev-latest-arm64 |
| 121 | +
|
| 122 | + - name: Create and push manifest for dev version |
| 123 | + run: | |
| 124 | + docker buildx imagetools create -t ${{ env.IMAGE_NAME }}:${{ env.DEV_VERSION }} \ |
| 125 | + ${{ env.IMAGE_NAME }}:${{ env.DEV_VERSION }}-amd64 \ |
| 126 | + ${{ env.IMAGE_NAME }}:${{ env.DEV_VERSION }}-arm64 |
0 commit comments