Skip to content

Commit 66c2bdc

Browse files
committed
Add release creation to publish workflow.
Make Docker Hub description update non-blocking and create a GitHub release per version.
1 parent 044ab48 commit 66c2bdc

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

.github/workflows/publish.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
build-and-push:
1616
runs-on: ubuntu-latest
1717
permissions:
18-
contents: read
18+
contents: write
1919

2020
steps:
2121
- uses: actions/checkout@v4
@@ -64,9 +64,24 @@ jobs:
6464

6565
- name: Update Docker Hub description
6666
uses: peter-evans/dockerhub-description@v4
67+
continue-on-error: true
6768
with:
6869
username: ${{ secrets.DOCKERHUB_USERNAME }}
6970
password: ${{ secrets.DOCKERHUB_TOKEN }}
7071
repository: ${{ env.IMAGE_NAME }}
7172
short-description: "GAIA Linux container"
7273
readme-filepath: ./docs/docker-hub-description.md
74+
75+
- name: Create GitHub release
76+
env:
77+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
78+
run: |
79+
VERSION="v${{ steps.version.outputs.version }}"
80+
if gh release view "$VERSION" >/dev/null 2>&1; then
81+
echo "Release $VERSION already exists."
82+
exit 0
83+
fi
84+
gh release create "$VERSION" \
85+
--title "$VERSION" \
86+
--notes "Docker image published: ${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }}" \
87+
--target "${{ github.sha }}"

0 commit comments

Comments
 (0)