Skip to content

Commit 1e90643

Browse files
committed
Add container build workflow
Container is built on every PR and published on all tags matching `v*`
1 parent cdaf928 commit 1e90643

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

.github/workflows/publish.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Image Checks
2+
3+
on:
4+
push:
5+
# Run only on release pushes
6+
tags:
7+
- v*
8+
# but all PRs
9+
pull_request:
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Set up Docker Buildx
19+
uses: docker/setup-buildx-action@v3
20+
21+
- name: Build image
22+
uses: docker/build-push-action@v5
23+
with:
24+
context: .
25+
cache-from: type=gha
26+
cache-to: type=gha
27+
tags: ci_test
28+
load: true
29+
30+
- name: Login to GHCR
31+
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
32+
uses: docker/login-action@v3
33+
with:
34+
registry: ghcr.io/${{ github.repository_owner }}
35+
username: ${{ github.actor }}
36+
password: ${{ secrets.GITHUB_TOKEN }}
37+
38+
- name: Publish image
39+
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
40+
uses: docker/build-push-action@v5
41+
with:
42+
context: .
43+
tags: ${{ github.ref_name }}
44+
push: true

0 commit comments

Comments
 (0)