-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (44 loc) · 1.46 KB
/
docker-publish.yaml
File metadata and controls
56 lines (44 loc) · 1.46 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
name: "Publish"
on:
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
publish:
name: Publish
permissions:
contents: read
packages: write
strategy:
matrix:
include:
- platform: linux/amd64
runner: ubuntu-latest
arch: amd64
- platform: linux/arm64
runner: ubuntu-24.04-arm
arch: aarch64
runs-on: ${{ matrix.runner }}
steps:
- name: Checkout the repository
uses: actions/checkout@v6
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get BUILD_VERSION
run: echo "$(grep "ARG BUILD_VERSION=" docker/Dockerfile | cut -d' ' -f2 | tr -d '"')" >> $GITHUB_ENV
- name: Get platform
run: echo "PLATFORM=$(echo ${{ matrix.arch }} | sed -e 's/aarch64/arm64/g')" >> $GITHUB_ENV
- name: Build and publish
uses: docker/build-push-action@master
with:
context: docker
push: true
platforms: linux/${{ env.PLATFORM }}
tags: ${{ env.REGISTRY }}/${{ github.repository }}/${{ matrix.arch }}:${{ env.BUILD_VERSION }}
build-args: |
"BUILD_ARCH=${{ matrix.arch }}"