Skip to content

Commit abcddfa

Browse files
Your Nameclaude
andcommitted
ci: add container publishing workflow
Automatically publishes to ghcr.io on release. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 6aa8751 commit abcddfa

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
2+
name: Publish Container
3+
4+
on:
5+
release:
6+
types: [published]
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
packages: write
12+
13+
jobs:
14+
publish:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
18+
19+
- name: Log in to GitHub Container Registry
20+
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3
21+
with:
22+
registry: ghcr.io
23+
username: ${{ github.actor }}
24+
password: ${{ secrets.GITHUB_TOKEN }}
25+
26+
- name: Extract metadata
27+
id: meta
28+
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5
29+
with:
30+
images: ghcr.io/${{ github.repository }}
31+
tags: |
32+
type=semver,pattern={{version}}
33+
type=semver,pattern={{major}}.{{minor}}
34+
type=semver,pattern={{major}}
35+
type=sha
36+
37+
- name: Build and push
38+
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6
39+
with:
40+
context: .
41+
file: ./Containerfile
42+
push: true
43+
tags: ${{ steps.meta.outputs.tags }}
44+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)