Skip to content

Commit

Permalink
feat(jellyfish): add deployment notification
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanspears committed Nov 1, 2023
1 parent 7e4ef45 commit a7f3a25
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/helm-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,9 @@ jobs:
prerelease: false
allowUpdates: true
omitBodyDuringUpdate: true
- name: Jellyfish Deploy Notification
if: inputs.environment == 'prod'
uses: encodium/.github/.github/workflows/jellyfish-deploy-notification.yaml@main
with:
environment: "${{ inputs.environment }}"
image_tag: "${{ inputs.image_tag }}"
35 changes: 35 additions & 0 deletions .github/workflows/jellyfish-deploy-notification.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Jellyfish Deploy Notification
on:
workflow_call:
inputs:
environment:
type: string
required: true
image_tag:
type: string
required: true

jobs:
get_date:
runs-on: ubuntu-latest
steps:
- name: Dynamically set environment variable
run: echo TIMESTAMP_NOW=$(date --iso-8601=seconds) >> $GITHUB_ENV

notify-jellyfish:
needs: get_date
runs-on: ubuntu-latest
steps:
- name: Notify Jellyfish of deployment
run: |
curl -i -X POST \
-H 'Content-Type: application/json' \
-H 'X-jf-api-token: ${{ secrets.JELLYFISH_API_TOKEN }}' \
-d '{
"reference_id": "${{ github.event.repository.name }}-${{ inputs.image_tag }}-${{ github.run_id }}",
"name": "${{ github.event.repository.name }} deployment of ${{ inputs.image_tag }} to ${{ inputs.environment }} complete",
"deployed_at": "${{ env.TIMESTAMP_NOW }}",
"repo_name": "${{ github.repository }}",
"commit_shas": ["${{ github.sha }}"]
}' \
https://webhooks.jellyfish.co/deployment

0 comments on commit a7f3a25

Please sign in to comment.