Skip to content

Commit 0a1b264

Browse files
committed
Added Release Feature
1 parent 2e2ff4e commit 0a1b264

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

.github/workflows/docker-img-push.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ on:
33
push:
44
branches:
55
- master
6+
tags:
7+
- 'v*'
68
pull_request:
79
jobs:
810
build:
@@ -53,3 +55,24 @@ jobs:
5355
tags: ghcr.io/${{ github.actor }}/${{ env.IMG_REPO_NAME }}:${{ env.TAG_NAME }}
5456
cache-from: type=registry,ref=ghcr.io/${{ github.actor }}/${{ env.IMG_REPO_NAME }}:${{ env.TAG_NAME }}
5557
cache-to: type=registry,ref=ghcr.io/${{ github.actor }}/${{ env.IMG_REPO_NAME }}:${{ env.TAG_NAME }},mode=max
58+
- name: Save Docker image to tarball
59+
if: github.event_name == 'push'
60+
run: |
61+
docker save ghcr.io/${{ github.actor }}/${{ env.IMG_REPO_NAME }}:${{ env.TAG_NAME }} -o ${{ env.IMG_REPO_NAME }}.tar
62+
- name: Create GitHub release
63+
if: github.event_name == 'push'
64+
uses: actions/create-release@v1
65+
with:
66+
tag_name: ${{ env.TAG_NAME }}
67+
release_name: Release ${{ env.TAG_NAME }}
68+
draft: false
69+
prerelease: false
70+
id: create_release
71+
- name: Upload tar as release asset
72+
if: github.event_name == 'push'
73+
uses: actions/upload-release-asset@v1
74+
with:
75+
upload_url: ${{ steps.create_release.outputs.upload_url }}
76+
asset_path: ./${{ env.IMG_REPO_NAME }}.tar
77+
asset_name: ${{ env.IMG_REPO_NAME }}.tar
78+
asset_content_type: application/x-tar

0 commit comments

Comments
 (0)