@@ -7,9 +7,14 @@ permissions:
77 contents : write
88 issues : write
99 pull-requests : write
10+ packages : write
1011
1112name : release-please
1213
14+ env :
15+ REGISTRY : ghcr.io
16+ IMAGE_NAME : ${{ github.repository }}
17+
1318jobs :
1419 release-please :
1520 runs-on : ubuntu-latest
4853 notion-md-linux-arm64 \
4954 notion-md-darwin-amd64 \
5055 notion-md-darwin-arm64 \
51- notion-md-windows-amd64.exe
56+ notion-md-windows-amd64.exe
57+
58+ # Build and push Docker image for releases
59+ - name : Set up Docker Buildx
60+ if : ${{ steps.release.outputs.release_created }}
61+ uses : docker/setup-buildx-action@v3
62+
63+ - name : Log in to Container Registry
64+ if : ${{ steps.release.outputs.release_created }}
65+ uses : docker/login-action@v3
66+ with :
67+ registry : ${{ env.REGISTRY }}
68+ username : ${{ github.actor }}
69+ password : ${{ secrets.GITHUB_TOKEN }}
70+
71+ - name : Extract metadata for Docker
72+ if : ${{ steps.release.outputs.release_created }}
73+ id : meta
74+ uses : docker/metadata-action@v5
75+ with :
76+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
77+ tags : |
78+ type=semver,pattern={{version}},value=${{ steps.release.outputs.tag_name }}
79+ type=semver,pattern={{major}}.{{minor}},value=${{ steps.release.outputs.tag_name }}
80+ type=semver,pattern={{major}},value=${{ steps.release.outputs.tag_name }}
81+ type=raw,value=latest
82+
83+ - name : Build and push Docker image
84+ if : ${{ steps.release.outputs.release_created }}
85+ uses : docker/build-push-action@v5
86+ with :
87+ context : .
88+ file : ./Containerfile
89+ platforms : linux/amd64,linux/arm64
90+ push : true
91+ tags : ${{ steps.meta.outputs.tags }}
92+ labels : ${{ steps.meta.outputs.labels }}
93+ cache-from : type=gha
94+ cache-to : type=gha,mode=max
0 commit comments