Skip to content

Commit 4eb17ec

Browse files
committed
Added workflow draft
1 parent 52fefe9 commit 4eb17ec

File tree

2 files changed

+71
-0
lines changed

2 files changed

+71
-0
lines changed

.github/workflows/docker.yaml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Build docker container on publish
2+
on:
3+
release:
4+
types: [ created, edited ]
5+
workflow_dispatch:
6+
inputs:
7+
tag:
8+
description: 'tag'
9+
required: true
10+
default: 'latest'
11+
type: string
12+
jobs:
13+
build:
14+
name: Build
15+
strategy:
16+
matrix:
17+
arch: [ amd64, arm64 ]
18+
version: [ 17-bookworm ]
19+
runs-on: ${{ matrix.arch == 'amd64' && 'ubuntu-latest' || matrix.arch == 'arm64' && 'nx1' }} # Builds on NX1 self-hosted
20+
env:
21+
ARCH: ${{ matrix.arch }}
22+
OS: linux
23+
VERSION: ${{ matrix.version }}
24+
DOCKER_REPO: ghcr.io/${{ github.repository }}
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0
30+
- name: Login
31+
uses: docker/login-action@v3
32+
with:
33+
registry: ghcr.io
34+
username: ${{ github.repository_owner }}
35+
password: ${{ secrets.GITHUB_TOKEN }}
36+
- name: Build and Push
37+
id: build
38+
run: |
39+
make docker && make docker-push
40+
manifest:
41+
name: Manifest
42+
needs: build
43+
strategy:
44+
matrix:
45+
version: [ 17-bookworm ]
46+
runs-on: ubuntu-latest
47+
steps:
48+
- name: Login
49+
uses: docker/login-action@v3
50+
with:
51+
registry: ghcr.io
52+
username: ${{ github.repository_owner }}
53+
password: ${{ secrets.GITHUB_TOKEN }}
54+
- uses: docker/metadata-action@v5
55+
id: metadata
56+
with:
57+
images: ghcr.io/${{ github.repository }}
58+
- uses: int128/docker-manifest-create-action@v2
59+
id: manifest
60+
with:
61+
index-annotations: ${{ steps.metadata.outputs.labels }}
62+
tags: ${{ steps.metadata.outputs.tags }}
63+
sources: |
64+
ghcr.io/${{ github.repository }}@${{ matrix.version }}
65+
ghcr.io/${{ github.repository }}@${{ matrix.version }}
66+

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ docker: docker-dep
2121
--build-arg VERSION=${VERSION} \
2222
-f Dockerfile .
2323

24+
# Push the docker image
25+
.PHONY: docker-push
26+
docker-push: docker
27+
@echo push docker image: ${BUILD_TAG}
28+
@${DOCKER} push ${BUILD_TAG}
2429

2530
###############################################################################
2631
# DEPENDENCIES

0 commit comments

Comments
 (0)