-
Notifications
You must be signed in to change notification settings - Fork 90
53 lines (46 loc) · 1.47 KB
/
build-and-push-docker-image.yml
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
name: Build and push Docker image
on:
release:
types: [published]
workflow_dispatch:
env:
CURRENT_VERSION: 27.3.1
BUILD_NUMBER: 2
LATEST_UBUNTU_VERSION: "24.04"
jobs:
docker:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- ubuntu_version: "20.04"
ubuntu_name: "focal"
- ubuntu_version: "22.04"
ubuntu_name: "jammy"
- ubuntu_version: "24.04"
ubuntu_name: "noble"
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: cruizba
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
push: true
file: Dockerfile
platforms: linux/amd64,linux/arm64
build-args: |
UBUNTU_VERSION=${{ matrix.ubuntu_version }}
tags: |
cruizba/ubuntu-dind:${{ matrix.ubuntu_name }}-${{ env.CURRENT_VERSION }}
cruizba/ubuntu-dind:${{ matrix.ubuntu_name }}-${{ env.CURRENT_VERSION }}-r${{ env.BUILD_NUMBER }}
cruizba/ubuntu-dind:${{ matrix.ubuntu_name }}-latest
${{ matrix.ubuntu_version == env.LATEST_UBUNTU_VERSION && 'cruizba/ubuntu-dind:latest' || '' }}