-
Notifications
You must be signed in to change notification settings - Fork 33
88 lines (76 loc) · 2.46 KB
/
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
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
name: Build Docker Image
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
ENABLE_QEMU: 1
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Get current date
id: now
run: echo "::set-output name=timestamp::$(date +%s)"
- name: Checkout
uses: actions/checkout@v4
- # Add support for more platforms with QEMU (optional)
# https://github.com/docker/setup-qemu-action
name: Set up QEMU
if: ${{ env.ENABLE_QEMU == '1' }}
uses: docker/setup-qemu-action@v3
# https://github.com/marketplace/actions/docker-setup-buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# See issue with multi-arch build + load : https://github.com/docker/buildx/issues/59
- name: Build images (multi-architecture)
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
platforms: |
linux/amd64
linux/386
linux/arm64/v8
push: false
load: false
tags: ghusta/postgres-world-db:ci_${{ steps.now.outputs.timestamp }}
- name: Build image for latest postgres
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
build-args: |
POSTGRES_TAG=latest
platforms: |
linux/amd64
linux/arm64/v8
push: false
load: false
tags: ghusta/postgres-world-db:ci_${{ steps.now.outputs.timestamp }}-latest
- name: Build image for latest alpine
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
build-args: |
POSTGRES_TAG=alpine
platforms: |
linux/amd64
linux/arm64/v8
push: false
load: false
tags: ghusta/postgres-world-db:ci_${{ steps.now.outputs.timestamp }}-alpine
# See : https://github.com/djimenezc/docker-multi-arch/commit/abf1ccfc0c37d4b9cbdce5a96b6fb5d48903e6a8
- name: Load only one architecture
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
platforms: linux/amd64
push: false
load: true
tags: ghusta/postgres-world-db:ci_${{ steps.now.outputs.timestamp }}
- name: List Docker images (arch linux/amd64)
run: docker image ls ghusta/*