diff --git a/.github/workflows/helm-deploy.yaml b/.github/workflows/helm-deploy.yaml index 31a1230..480e6ca 100644 --- a/.github/workflows/helm-deploy.yaml +++ b/.github/workflows/helm-deploy.yaml @@ -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 }}" diff --git a/.github/workflows/jellyfish-deploy-notification.yaml b/.github/workflows/jellyfish-deploy-notification.yaml new file mode 100644 index 0000000..7bec73a --- /dev/null +++ b/.github/workflows/jellyfish-deploy-notification.yaml @@ -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