Skip to content

Commit c27ccdf

Browse files
authored
Merge pull request #285 from silinternational/develop
Release 10.1.3 --Push for ghcr.io image
2 parents 625a845 + 540979f commit c27ccdf

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

.github/workflows/test-and-publish.yml

+16-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: Test and Publish
22

33
on:
44
push:
5+
branches: [ 'main' ] #Triger on the main branch
6+
tags: [ '[0-9]+.[0-9]+.[0-9]+' ] # Trigger on version tags like '0.1.0'
57

68
jobs:
79
tests:
@@ -22,26 +24,38 @@ jobs:
2224
run: docker compose run ssp-sp1.local ./run-metadata-tests.sh
2325

2426
build-and-publish:
25-
name: Build and Publish
27+
name: Build and Publish Docker image
2628
needs: tests
2729
runs-on: ubuntu-latest
2830
steps:
2931
- name: Checkout code
3032
uses: actions/checkout@v4
33+
3134
- name: Log in to Docker Hub
3235
uses: docker/login-action@v3
3336
with:
3437
username: ${{ secrets.DOCKERHUB_USERNAME }}
3538
password: ${{ secrets.DOCKERHUB_TOKEN }}
39+
40+
- name: Log in to GitHub Container Registry
41+
uses: docker/login-action@v3
42+
with:
43+
registry: ghcr.io
44+
username: ${{ github.actor }}
45+
password: ${{ secrets.GITHUB_TOKEN }}
46+
3647
- name: Extract metadata (tags, labels) for Docker
3748
id: meta
3849
uses: docker/metadata-action@v5
3950
with:
40-
images: ${{ vars.DOCKER_ORG }}/${{ github.event.repository.name }}
51+
images: |
52+
${{ vars.DOCKER_ORG }}/${{ github.event.repository.name }}
53+
ghcr.io/${{ github.repository }}
4154
tags: |
4255
type=ref,event=branch
4356
type=semver,pattern={{version}}
4457
type=semver,pattern={{major}}.{{minor}}
58+
4559
- name: Build and push Docker image
4660
uses: docker/build-push-action@v5
4761
with:

0 commit comments

Comments
 (0)