File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Publish
2+
3+ on :
4+ release :
5+ types : [published]
6+
7+ env :
8+ IMAGE_NAME : release-upload-asset
9+
10+ jobs :
11+ publish :
12+ runs-on : ubuntu-latest
13+ steps :
14+ - name : Checkout repository
15+ uses : actions/checkout@v4
16+
17+ - name : Build image
18+ run : docker build . --file Dockerfile --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}"
19+
20+ - name : Log in to GitHub Container Registry
21+ run : echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
22+
23+ - name : Push image
24+ run : |
25+ IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
26+ IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
27+ TAG=${{ github.event.release.tag_name }}
28+ VERSION=${TAG#v}
29+ docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
30+ docker push $IMAGE_ID:$VERSION
You can’t perform that action at this time.
0 commit comments