diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ff563e6..2f4cf84 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -179,11 +179,30 @@ jobs: run: | VERSION="v${{ needs.build.outputs.version }}" REPO_NAME="${{ github.repository }}" + RELEASE_URL="${{ github.server_url }}/${{ github.repository }}/releases/tag/${VERSION}" + COMMIT_SHA="${{ github.sha }}" + SHORT_SHA="${COMMIT_SHA:0:7}" + + MESSAGE="Version ${VERSION} deployed successfully to production. + +Release Details: +- Repository: ${REPO_NAME} +- Commit: ${SHORT_SHA} +- Branch: ${{ github.ref_name }} + +Available platforms: +- Linux (AMD64/ARM64) +- macOS (Intel/Apple Silicon) +- Windows (AMD64) + +Release: ${RELEASE_URL}" curl -s --form-string "token=${{ secrets.PUSHOVER_API_TOKEN }}" \ --form-string "user=${{ secrets.PUSHOVER_USER_KEY }}" \ - --form-string "title=✅ Deploy Success: ${REPO_NAME}" \ - --form-string "message=Version ${VERSION} deployed successfully to production" \ + --form-string "title=[OK] Deploy Success: ${REPO_NAME}" \ + --form-string "message=${MESSAGE}" \ + --form-string "url=${RELEASE_URL}" \ + --form-string "url_title=View Release" \ --form-string "priority=0" \ --form-string "sound=pushover" \ https://api.pushover.net/1/messages.json @@ -194,11 +213,25 @@ jobs: VERSION="v${{ needs.build.outputs.version }}" REPO_NAME="${{ github.repository }}" WORKFLOW_URL="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + COMMIT_SHA="${{ github.sha }}" + SHORT_SHA="${COMMIT_SHA:0:7}" + + MESSAGE="Version ${VERSION} deployment failed. + +Details: +- Repository: ${REPO_NAME} +- Commit: ${SHORT_SHA} +- Branch: ${{ github.ref_name }} +- Workflow Run: ${{ github.run_id }} + +Check the workflow logs for more information." curl -s --form-string "token=${{ secrets.PUSHOVER_API_TOKEN }}" \ --form-string "user=${{ secrets.PUSHOVER_USER_KEY }}" \ - --form-string "title=❌ Deploy Failed: ${REPO_NAME}" \ - --form-string "message=Version ${VERSION} deployment failed. Check: ${WORKFLOW_URL}" \ + --form-string "title=[FAIL] Deploy Failed: ${REPO_NAME}" \ + --form-string "message=${MESSAGE}" \ + --form-string "url=${WORKFLOW_URL}" \ + --form-string "url_title=View Workflow Logs" \ --form-string "priority=1" \ --form-string "sound=siren" \ https://api.pushover.net/1/messages.json diff --git a/.github/workflows/pushover-notify.yml b/.github/workflows/pushover-notify.yml index ef78ca6..c8df2e0 100644 --- a/.github/workflows/pushover-notify.yml +++ b/.github/workflows/pushover-notify.yml @@ -15,6 +15,18 @@ on: description: 'URL to the workflow run' required: false type: string + release_url: + description: 'URL to the release page' + required: false + type: string + commit_sha: + description: 'Commit SHA for this release' + required: false + type: string + branch: + description: 'Branch name' + required: false + type: string secrets: PUSHOVER_USER_KEY: required: true @@ -29,27 +41,57 @@ jobs: run: | REPO_NAME="${{ github.repository }}" VERSION="${{ inputs.version }}" + COMMIT_SHA="${{ inputs.commit_sha }}" + SHORT_SHA="${COMMIT_SHA:0:7}" + BRANCH="${{ inputs.branch }}" if [ "${{ inputs.status }}" == "success" ]; then - TITLE="✅ Deploy Success: ${REPO_NAME}" - MESSAGE="Version ${VERSION} deployed successfully to production" + RELEASE_URL="${{ inputs.release_url }}" + if [ -z "${RELEASE_URL}" ]; then + RELEASE_URL="${{ github.server_url }}/${{ github.repository }}/releases/tag/${VERSION}" + fi + + TITLE="[OK] Deploy Success: ${REPO_NAME}" + MESSAGE="Version ${VERSION} deployed successfully to production. + +Release Details: +- Repository: ${REPO_NAME} +- Commit: ${SHORT_SHA} +- Branch: ${BRANCH} + +Release: ${RELEASE_URL}" PRIORITY="0" SOUND="pushover" + URL="${RELEASE_URL}" + URL_TITLE="View Release" else WORKFLOW_URL="${{ inputs.workflow_url }}" if [ -z "${WORKFLOW_URL}" ]; then WORKFLOW_URL="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" fi - TITLE="❌ Deploy Failed: ${REPO_NAME}" - MESSAGE="Version ${VERSION} deployment failed. Check: ${WORKFLOW_URL}" + + TITLE="[FAIL] Deploy Failed: ${REPO_NAME}" + MESSAGE="Version ${VERSION} deployment failed. + +Details: +- Repository: ${REPO_NAME} +- Commit: ${SHORT_SHA} +- Branch: ${BRANCH} +- Workflow Run: ${{ github.run_id }} + +Check the workflow logs for more information." PRIORITY="1" SOUND="siren" + URL="${WORKFLOW_URL}" + URL_TITLE="View Workflow Logs" fi curl -s --form-string "token=${{ secrets.PUSHOVER_API_TOKEN }}" \ --form-string "user=${{ secrets.PUSHOVER_USER_KEY }}" \ --form-string "title=${TITLE}" \ --form-string "message=${MESSAGE}" \ + --form-string "url=${URL}" \ + --form-string "url_title=${URL_TITLE}" \ --form-string "priority=${PRIORITY}" \ --form-string "sound=${SOUND}" \ https://api.pushover.net/1/messages.json