Skip to content

Commit 0d3ed38

Browse files
authored
Building docker images during CI/CD and publish on tag (#29)
* build docker image * Fixing right dockerfile version * Publishing only on tags
1 parent 01508b3 commit 0d3ed38

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

.github/workflows/k8s.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Kubernetes
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v3
13+
14+
- name: Set up Docker Buildx
15+
uses: docker/setup-buildx-action@v3
16+
17+
- name: Log in to GitHub Container Registry
18+
if: startsWith(github.ref, 'refs/tags/')
19+
uses: docker/login-action@v3
20+
with:
21+
registry: ghcr.io
22+
username: ${{ github.actor }}
23+
password: ${{ secrets.GITHUB_TOKEN }}
24+
25+
- name: Build and push Docker image
26+
uses: docker/build-push-action@v6
27+
with:
28+
context: .
29+
file: ./k8s/Dockerfile
30+
tags: username/repository:tag
31+
# Push only on tags
32+
push: ${{ startsWith(github.ref, 'refs/tags/') }}

0 commit comments

Comments
 (0)