Skip to content

Commit

Permalink
Trigger process notifications mutation from Github workflow (#3177)
Browse files Browse the repository at this point in the history
* Add workflows to process notifications post deploy

* Delete old netlify plugin

* Use var instead
  • Loading branch information
cesarvarela authored Oct 24, 2024
1 parent d45406b commit 48b7bd5
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 100 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/process-notifications.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Process Notifications

on:
workflow_call:
inputs:
environment:
description: The Github environment to load secrets from
type: string
required: true

jobs:
execute-mutation:
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}

steps:
- name: Call GraphQL API
env:
SITE_URL: ${{ vars.SITE_URL }}
PROCESS_NOTIFICATIONS_SECRET: ${{ secrets.PROCESS_NOTIFICATIONS_SECRET }}
run: |
curl -X POST "$SITE_URL/api/graphql" \
-H "Content-Type: application/json" \
-H "PROCESS_NOTIFICATIONS_SECRET: $PROCESS_NOTIFICATIONS_SECRET" \
-d '{"query":"mutation { processNotifications }"}'
7 changes: 7 additions & 0 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,10 @@ jobs:
netlify-alias:
runner-label: ${{ vars.PRODUCTION_RUNNER_LABEL }}
cache-modifier: ${{ needs.cache-modifier.outputs.cache-modifier }}

call-process-notifications:
needs: call-deploy
uses: ./.github/workflows/process-notifications.yml
secrets: inherit
with:
environment: production
7 changes: 7 additions & 0 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,10 @@ jobs:
netlify-alias:
runner-label: ${{ vars.STAGING_RUNNER_LABEL }}
cache-modifier: ${{ needs.cache-modifier.outputs.cache-modifier }}

call-process-notifications:
needs: call-deploy
uses: ./.github/workflows/process-notifications.yml
secrets: inherit
with:
environment: staging
3 changes: 0 additions & 3 deletions site/gatsby-site/deploy-netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
[[plugins]]
package = "/plugins/netlify-plugin-create-admin-user"

[[plugins]]
package = "/plugins/netlify-plugin-process-notifications"

[build.processing.html]
pretty_urls = false

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 48b7bd5

Please sign in to comment.