Skip to content

Commit 84fd9a1

Browse files
ci: container action
Signed-off-by: Henry Gressmann <[email protected]>
1 parent 6e2b982 commit 84fd9a1

File tree

2 files changed

+45
-36
lines changed

2 files changed

+45
-36
lines changed

.github/workflows/container.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: "Build & Publish Container Image"
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
docker-build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
- name: Setup Docker Buildx
12+
uses: docker/setup-buildx-action@v1
13+
- name: Extract Semver
14+
id: semver
15+
run: |
16+
SEMVER_VERSION=$(echo "${GITHUB_REF_NAME}" | sed 's/^liwan-v//')
17+
echo "SEMVER_VERSION=$SEMVER_VERSION" >> $GITHUB_OUTPUT
18+
- name: Setup Docker Metadata
19+
uses: docker/metadata-action@v5
20+
id: meta
21+
with:
22+
images: ghcr.io/${{ github.actor }}/liwan
23+
tags: |
24+
type=semver,pattern={{version}},value=${{ steps.semver.outputs.SEMVER_VERSION }}
25+
type=semver,pattern={{major}}.{{minor}},value=${{ steps.semver.outputs.SEMVER_VERSION }}
26+
type=semver,pattern={{major}},value=${{ steps.semver.outputs.SEMVER_VERSION }}
27+
- name: Login to GitHub Container Registry
28+
uses: docker/login-action@v3
29+
with:
30+
registry: ghcr.io
31+
username: ${{ github.actor }}
32+
password: ${{ secrets.GITHUB_TOKEN }}
33+
- name: Build and push Docker images
34+
uses: docker/build-push-action@v5
35+
with:
36+
context: .
37+
push: true
38+
tags: ${{ steps.meta.outputs.tags }}
39+
labels: ${{ steps.meta.outputs.labels }}
40+
platforms: |
41+
linux/amd64
42+
linux/arm64
43+
build-args: |
44+
TAR_URL_AMD64=https://github.com/explodingcamera/liwan/releases/download/${{ github.ref_name }}/liwan-amd64-linux.tar.gz
45+
TAR_URL_ARM64=https://github.com/explodingcamera/liwan/releases/download/${{ github.ref_name }}/liwan-aarch64-linux.tar.gz

.github/workflows/release.yaml

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -68,39 +68,3 @@ jobs:
6868
target: ${{ matrix.target }}
6969
build-tool: ${{ matrix.build-tool }}
7070
token: ${{ secrets.GITHUB_TOKEN }}
71-
72-
docker-build:
73-
needs: [upload-assets]
74-
runs-on: ubuntu-latest
75-
steps:
76-
- uses: actions/checkout@v4
77-
- name: Setup Docker Buildx
78-
uses: docker/setup-buildx-action@v1
79-
- name: Setup Docker Metadata
80-
uses: docker/metadata-action@v5
81-
id: meta
82-
with:
83-
images: ghcr.io/${{ github.actor }}/liwan
84-
tags: |
85-
type=semver,pattern={{version}}
86-
type=semver,pattern={{major}}.{{minor}}
87-
type=semver,pattern={{major}}
88-
- name: Login to GitHub Container Registry
89-
uses: docker/login-action@v3
90-
with:
91-
registry: ghcr.io
92-
username: ${{ github.actor }}
93-
password: ${{ secrets.GITHUB_TOKEN }}
94-
- name: Build and push Docker images
95-
uses: docker/build-push-action@v5
96-
with:
97-
context: .
98-
push: true
99-
tags: ${{ steps.meta.outputs.tags }}
100-
labels: ${{ steps.meta.outputs.labels }}
101-
platforms: |
102-
linux/amd64
103-
linux/arm64
104-
build-args: |
105-
TAR_URL_AMD64=https://github.com/explodingcamera/liwan/releases/download/${{ github.ref_name }}/liwan-amd64-linux.tar.gz
106-
TAR_URL_ARM64=https://github.com/explodingcamera/liwan/releases/download/${{ github.ref_name }}/liwan-aarch64-linux.tar.gz

0 commit comments

Comments
 (0)