feat: optimised docker file #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and publish Docker Image to Dockerhub | |
on: | |
push: | |
branches: | |
- 'main' | |
paths-ignore: | |
- '**.md' | |
- 'LICENSE' | |
jobs: | |
docker: | |
name: Push Docker image to Docker Hub | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
- name: Extract metadata (tags, labels) | |
id: meta | |
uses: docker/metadata-action@v2 | |
with: | |
images: metakgp/kronos | |
- name: Build and push docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: true | |
tags: metakgp/kronos:latest | |
labels: ${{ steps.meta.outputs.labels }} |