Skip to content

Commit

Permalink
add notify to discord workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
JeromeBu committed May 19, 2023
1 parent fff507c commit 28ccb33
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/cd-discord-notification.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Discord Notification

on:
# workflow_dispatch:
# inputs:
# tag:
# type: string
# required: true
# description: The version tag
# environment:
# type: string
# description: Environment to send notification to. Will change the discord chanel to notify.
# required: true
# DISCORD_WEBHOOK_URL:
# type: string
# description: Discord webhook URL
# required: true
workflow_call:
inputs:
tag:
type: string
required: true
description: The version tag
environment:
type: string
description: Environment to send notification to. Will change the discord chanel to notify.
required: true

jobs:
send-notification:
name: Send Discord notification
environment:
name: ${{ inputs.environment }}
runs-on: ubuntu-latest
steps:
- name: Send Discord notification
run: |
curl -X POST -H "Content-Type: application/json" -d '{
"content": "La ${{ inputs.tag }} est deployée en ${{ inputs.environment }}",
"embeds": [
{
"title": "Liens utiles :",
"fields": [
{
"name": "Changelog :",
"value": "https://www.notion.so/gip-inclusion/Journal-des-modifications-3831ee7ed3ba48e6bd29aac47c0a7f78"
},
{
"name": "Application :",
"value": "https://${{ inputs.environment }}.immersion-facile.beta.gouv.fr"
},
{
"name": "Pour passer au prochain environnement, validez ici",
"value": "${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }}"
}
]
}
]
}' ${{ secrets.DISCORD_WEBHOOK_URL }}
9 changes: 9 additions & 0 deletions .github/workflows/ci-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,22 @@ jobs:
uses: ./.github/workflows/build-back-artefact.yml

deploy-dev:
name: Deploy dev
needs: [validation, build-front-artefact, build-back-artefact]
uses: ./.github/workflows/deploy-to-scalingo.yml
with:
environment: dev
secrets:
SCALINGO_API_TOKEN: ${{ secrets.SCALINGO_API_TOKEN }}

notify-discord:
name: Notify deploy success
needs: [deploy-dev]
uses: ./.github/workflows/cd-discord-notification.yml
with:
environment: dev
tag: v404

merge-to-staging:
needs: [deploy-dev]
environment: staging
Expand Down

0 comments on commit 28ccb33

Please sign in to comment.