Skip to content

Commit 0cd938a

Browse files
committed
Add container build workflow
1 parent c4b4d13 commit 0cd938a

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.github/workflows/publish.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,43 @@ name: Image Publishing
22

33
on:
44
push:
5+
# Run only on release pushes
56
tags:
67
- v*
8+
# but all PRs
9+
pull_request:
710

811
jobs:
912
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+
29+
- name: Login to GHCR
30+
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
31+
uses: docker/login-action@v3
32+
with:
33+
registry: ghcr.io/${{ github.repository_owner }}
34+
username: ${{ github.actor }}
35+
password: ${{ secrets.GITHUB_TOKEN }}
36+
37+
- name: Publish image
38+
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
39+
uses: docker/build-push-action@v5
40+
with:
41+
context: .
42+
tags: ${{ github.ref_name }}
43+
cache-from: type=gha
44+
push: true

0 commit comments

Comments
 (0)