Skip to content

Commit

Permalink
remove notification url
Browse files Browse the repository at this point in the history
causes build to fail, removed notification to avoid dead-url coupling
  • Loading branch information
kasutu authored Nov 11, 2023
1 parent b00afc9 commit ea622b8
Showing 1 changed file with 1 addition and 30 deletions.
31 changes: 1 addition & 30 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ on:
- 'master'
env:
IMAGE_NAME: shield
NOTIFICATION_URL: 'http://splitscale.systems:3030/notifications'
NOTIFICATION_TITLE: 'Default title'
NOTIFICATION_INFO: 'Default info'
JOB_URL: 'Default job url'


jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -34,28 +30,3 @@ jobs:
file: ./dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:latest

- name: Set NOTIFICATION_TITLE, NOTIFICATION_INFO and JOB_URL
run: |
repo_name=${{ github.repository }}
branch_name=${GITHUB_REF#refs/heads/}
title="[$repo_name:$branch_name]"
echo "NOTIFICATION_TITLE=$title" >> $GITHUB_ENV
server_url=${{ github.server_url }}
repo=${{ github.repository }}
run_id=${{ github.run_id }}
job_url="$server_url/$repo/actions/runs/$run_id"
echo "JOB_URL=$job_url" >> $GITHUB_ENV
echo "NOTIFICATION_INFO=${{ github.event.head_commit.message }}" >> $GITHUB_ENV
- name: Check if job succeeded
if: ${{ success() }}
run: |
curl -X POST -H "Content-Type: application/json" -d "{\"title\":\"${{ env.NOTIFICATION_TITLE }} ${{ github.workflow }}\",\"url\":\"${{ env.JOB_URL }}\",\"content\":{\"status\":\"deployed 🚀\",\"info\":\"${{ env.NOTIFICATION_INFO }}\"}}" ${{ env.NOTIFICATION_URL }}
- name: Check if job failed
if: ${{ failure() }}
run: |
curl -X POST -H "Content-Type: application/json" -d "{\"title\":\"${{ env.NOTIFICATION_TITLE }} ${{ github.workflow }}\",\"url\":\"${{ env.JOB_URL }}\",\"content\":{\"status\":\"failed ❌\",\"info\":\"${{ env.NOTIFICATION_INFO }}\"}}" ${{ env.NOTIFICATION_URL }}

0 comments on commit ea622b8

Please sign in to comment.