Skip to content

Commit e038a48

Browse files
committed
fix: GHCR action
1 parent 03b0c77 commit e038a48

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

.github/workflows/publish-ghcr.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
name: Publish Image to GitHub Container Registry
1+
name: Publish Package - GHCR
22

33
on:
4-
push:
5-
branches: ["main"]
4+
release:
5+
types: [published]
66

77
env:
88
REGISTRY: ghcr.io
@@ -32,10 +32,18 @@ jobs:
3232
with:
3333
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
3434

35+
- name: Read YAML file for version
36+
uses: pietrobolcato/[email protected]
37+
id: read_yaml
38+
with:
39+
config: ${{ github.workspace }}/version.yaml
40+
3541
- name: Build and push Docker image
3642
uses: docker/build-push-action@v4
3743
with:
3844
context: .
3945
push: true
40-
tags: ghcr.io/pradumnasaraf/contributors:latest
46+
tags: |
47+
ghcr.io/pradumnasaraf/contributors:latest
48+
ghcr.io/pradumnasaraf/contributors:${{ steps.read_yaml.outputs['version'] }}
4149
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)