Skip to content

Commit

Permalink
Building docker images during CI/CD and publish on tag (#29)
Browse files Browse the repository at this point in the history
* build docker image

* Fixing right dockerfile version

* Publishing only on tags
  • Loading branch information
edmondop authored Oct 13, 2024
1 parent 01508b3 commit 0d3ed38
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/k8s.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Kubernetes

on:
push:
pull_request:

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GitHub Container Registry
if: startsWith(github.ref, 'refs/tags/')
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
file: ./k8s/Dockerfile
tags: username/repository:tag
# Push only on tags
push: ${{ startsWith(github.ref, 'refs/tags/') }}

0 comments on commit 0d3ed38

Please sign in to comment.