Skip to content

Commit

Permalink
updated the tags
Browse files Browse the repository at this point in the history
updated the tags and added the main and master branch with will be moved to main in the future.
  • Loading branch information
Praveenraj-K authored Oct 8, 2024
1 parent 8a41cb9 commit 4919122
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ name: Build and Publish

on:
push:
branches:
- main
branches: [ 'main', 'master' ] # Trigger on push to 'main'& 'master' master will be remove step by step
tags: [ '[0-9]+.[0-9]+.[0-9]+' ] # Trigger on version tags like '0.1.0'

jobs:
build-and-publish:
name: Build and Publish Docker Image
name: Build and Publish Docker image
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand All @@ -30,14 +30,20 @@ jobs:
id: meta
uses: docker/metadata-action@v5
with:
images: |
images: |
${{ vars.DOCKER_ORG }}/${{ github.event.repository.name }}
ghcr.io/${{ github.repository }}
tags: |
type=ref,event=branch # Tag with branch name
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
# labels: |
# org.opencontainers.image.source=${{ github.repository }}
# org.opencontainers.image.revision=${{ github.sha }}
# org.opencontainers.image.created=${{ github.event.head_commit.timestamp }}

- name: Build and push Docker image to Docker Hub and GHCR
- name: Build and push Docker image to DockerHub and GHCR
uses: docker/build-push-action@v5
with:
context: .
Expand Down

0 comments on commit 4919122

Please sign in to comment.