mirror of
https://github.com/adityachandelgit/BookLore.git
synced 2026-02-11 22:39:04 -06:00
feat: notify Discord on new release with drafter info and Docker image links
This commit is contained in:
committed by
Aditya Chandel
parent
d2150f5713
commit
4228c64a1b
20
.github/workflows/docker-build-publish.yml
vendored
20
.github/workflows/docker-build-publish.yml
vendored
@@ -157,4 +157,22 @@ jobs:
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
gh release edit ${{ env.new_tag }} --draft=false
|
||||
gh release edit ${{ env.new_tag }} --draft=false
|
||||
|
||||
- name: Notify Discord of New Release
|
||||
if: github.ref == 'refs/heads/master'
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
|
||||
run: |
|
||||
release_json=$(gh release view ${{ env.new_tag }} --json name,body,url)
|
||||
release_name=$(echo "$release_json" | jq -r '.name')
|
||||
release_body=$(echo "$release_json" | jq -r '.body')
|
||||
release_url=$(echo "$release_json" | jq -r '.url')
|
||||
dockerhub_image="https://hub.docker.com/r/booklore/booklore-app/tags"
|
||||
ghcr_image="https://github.com/${{ github.repository }}/packages"
|
||||
content=":tada: **New Release:** [$release_name]($release_url)\n\n$release_body\n\n**Docker Images:**\n- Docker Hub: \`booklore/booklore-app:${{ env.new_tag }}\` ([View]($dockerhub_image))\n- GHCR: \`ghcr.io/${{ github.repository }}/booklore-app:${{ env.new_tag }}\` ([View]($ghcr_image))"
|
||||
payload="{\"content\": \"$content\"}"
|
||||
curl -H "Content-Type: application/json" -X POST -d "$payload" $DISCORD_WEBHOOK_URL
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user