Skip to content

Commit f1c3734

Browse files
Update create-release.yml
1 parent 5f9288c commit f1c3734

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

.github/workflows/create-release.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,35 @@ jobs:
1313
steps:
1414
- name: Checkout code
1515
uses: actions/checkout@v2
16+
17+
- name: Test for get release data
18+
run: |
19+
IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/$IMAGE_NAME
20+
21+
echo IMAGE_ID
22+
23+
# Change all uppercase to lowercase
24+
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
25+
26+
# Strip git ref prefix from version
27+
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
28+
29+
# Strip "v" prefix from tag name
30+
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
31+
32+
# Use Docker `latest` tag convention
33+
[ "$VERSION" == "master" ] && VERSION=latest
34+
35+
echo IMAGE_ID=$IMAGE_ID
36+
echo VERSION=$VERSION
37+
38+
docker tag image $IMAGE_ID:$VERSION
39+
docker push $IMAGE_ID:$VERSION
40+
1641
- name: Create Release
1742
id: create_release
1843
uses: actions/create-release@v1
44+
1945
env:
2046
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2147
with:

0 commit comments

Comments
 (0)