Skip to content

Commit 6b9fa9c

Browse files
authored
ci: set up publishing docker image (#14)
* ci: set up publishing docker image * push only on tags
1 parent cf63af3 commit 6b9fa9c

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Docker Build and Push
2+
3+
on:
4+
push:
5+
tags: ["v*"]
6+
7+
permissions:
8+
contents: read
9+
packages: write
10+
11+
jobs:
12+
docker:
13+
name: Build and Push Docker Image
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
18+
19+
- name: Login to GitHub Container Registry
20+
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
21+
with:
22+
registry: ghcr.io
23+
username: ${{ github.actor }}
24+
password: ${{ secrets.GITHUB_TOKEN }}
25+
26+
- name: Build and push
27+
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
28+
with:
29+
context: .
30+
push: true
31+
tags: |
32+
ghcr.io/${{ github.repository }}:latest
33+
ghcr.io/${{ github.repository }}:${{ github.ref_name }}

0 commit comments

Comments
 (0)