-
Notifications
You must be signed in to change notification settings - Fork 8
71 lines (58 loc) · 2.06 KB
/
docker.yml
File metadata and controls
71 lines (58 loc) · 2.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
name: Docker build
on:
workflow_dispatch:
pull_request:
push:
branches:
- trunk
jobs:
build-images:
name: Build Docker Images
strategy:
matrix:
include:
- tag: amd64
features: ""
image: ubuntu-latest
- tag: armv8
features: ""
image: ubuntu-24.04-arm
runs-on: ${{ matrix.image }}
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Login to ghcr
if: github.ref == 'refs/heads/trunk' && github.event_name != 'pull_request'
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | podman login -u ${{ github.repository_owner }} --password-stdin ghcr.io
- name: Convert GITHUB_REPOSITORY into lowercase
run: |
echo "REPO=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV}
- name: Build ${{ matrix.tag }}
run: |
podman build \
--format docker \
--build-arg FEATURES=${{ matrix.features }} \
-t gateway-queue:${{ matrix.tag }} \
.
- name: Push image
if: github.ref == 'refs/heads/trunk' && github.event_name != 'pull_request'
run: |
podman tag gateway-queue:${{ matrix.tag }} ghcr.io/${REPO}:${{ matrix.tag }}
podman push ghcr.io/${REPO}:${{ matrix.tag }}
create-manifest:
name: Create Docker manifests
runs-on: ubuntu-latest
needs: build-images
if: github.ref == 'refs/heads/trunk' && github.event_name != 'pull_request'
steps:
- name: Login to ghcr
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | podman login -u ${{ github.repository_owner }} --password-stdin ghcr.io
- name: Convert GITHUB_REPOSITORY into lowercase
run: |
echo "REPO=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV}
- name: Create manifest and push it
run: |
podman manifest create gateway-queue-latest docker://ghcr.io/${REPO}:amd64 docker://ghcr.io/${REPO}:armv8
podman manifest push --format v2s2 gateway-queue-latest docker://ghcr.io/${REPO}:latest