Skip to content

Commit

Permalink
Merge pull request #379 from silinternational/develop
Browse files Browse the repository at this point in the history
Pushing Docker Image to GHCR.io
  • Loading branch information
Praveenraj-K authored Oct 21, 2024
2 parents 1e83429 + 6f29fbe commit 7532e91
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions .github/workflows/test-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,27 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ vars.DOCKER_ORG }}/${{ github.event.repository.name }}
images: |
${{ vars.DOCKER_ORG }}/${{ github.event.repository.name }}
ghcr.io/${{ github.repository }}
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Build and push Docker image
- name: Build and push Docker image to Docker Hub
uses: docker/build-push-action@v5
with:
context: .
Expand All @@ -47,3 +58,14 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
build-args: |
GITHUB_REF_NAME=${{ github.ref_name }}
- name: Build and push Docker image to GitHub Container Registry
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
ghcr.io/${{ github.repository }}:${{ github.ref_name }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
GITHUB_REF_NAME=${{ github.ref_name }}

0 comments on commit 7532e91

Please sign in to comment.