Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

Commit

Permalink
ci: dyanmic deploy based on webhook payload
Browse files Browse the repository at this point in the history
  • Loading branch information
sergioramos committed Feb 27, 2023
1 parent 45817e1 commit 5026e9a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/on-dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ jobs:
run: yarn run build
env:
CMS_CRUD: ${{ secrets.CMS_CRUD }}
CONTENTFUL_SPACE: ${{ secrets.CONTENTFUL_SPACE }}
CONTENTFUL_SPACE: ${{ github.event.client_payload.spaceId }}
CONTENTFUL_TOKEN: ${{ secrets.CONTENTFUL_TOKEN }}
GA_TRACKING_ID: ${{ secrets.GA_TRACKING_ID }}
TAG_MANAGER_ID: ${{ secrets.TAG_MANAGER_ID }}
FATHOM_SITE_ID: ${{ secrets.FATHOM_SITE_ID }}
PLAUSIBLE_CUSTOM_DOMAIN: ${{ secrets.PLAUSIBLE_CUSTOM_DOMAIN }}
GOOGLE_SITE_VERIFICATION_META_CONTENT: ${{ secrets.GOOGLE_SITE_VERIFICATION_META_CONTENT }}
GATSBY_CONTACT_US_ENDPOINT_URI: ${{ secrets.CONTACT_US_ENDPOINT_URI }}
CONTENTFUL_ENVIRONMENT: ${{ github.event.client_payload.environment }}
CONTENTFUL_HOST: ${{ github.event.client_payload.host }}
NODE_ENV: production
- name: Get branch
uses: rlespinasse/[email protected]
- name: Deploy to Netlify
id: deploy
uses: nwtgck/actions-netlify@v2
Expand All @@ -44,7 +44,7 @@ jobs:
enable-commit-comment: false
enable-commit-status: false
overwrites-pull-request-comment: true
github-deployment-environment: ${{ env.GITHUB_HEAD_REF_SLUG || env.GITHUB_REF_SLUG }}
github-deployment-environment: ${{ github.event.client_payload.environment }}
fails-without-credentials: true
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ jobs:
PLAUSIBLE_CUSTOM_DOMAIN: ${{ secrets.PLAUSIBLE_CUSTOM_DOMAIN }}
GOOGLE_SITE_VERIFICATION_META_CONTENT: ${{ secrets.GOOGLE_SITE_VERIFICATION_META_CONTENT }}
GATSBY_CONTACT_US_ENDPOINT_URI: ${{ secrets.CONTACT_US_ENDPOINT_URI }}
CONTENTFUL_ENVIRONMENT: master
NODE_ENV: production

###############################################################################
Expand Down Expand Up @@ -141,6 +142,7 @@ jobs:
CMS_CRUD: ${{ secrets.CMS_CRUD }}
CONTENTFUL_SPACE: ${{ secrets.CONTENTFUL_SPACE }}
CONTENTFUL_TOKEN: ${{ secrets.CONTENTFUL_TOKEN }}
CONTENTFUL_ENVIRONMENT: master
NODE_ENV: test

###############################################################################
Expand Down
5 changes: 4 additions & 1 deletion gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ const path = require('path');
const {
CONTENTFUL_TOKEN,
CONTENTFUL_SPACE,
CONTENTFUL_ENVIRONMENT = 'master',
CONTENTFUL_HOST,
GA_TRACKING_ID,
TAG_MANAGER_ID,
GOOGLE_SITE_VERIFICATION_META_CONTENT,
Expand Down Expand Up @@ -205,7 +207,8 @@ const configs = {
options: {
spaceId: CONTENTFUL_SPACE,
accessToken: CONTENTFUL_TOKEN,
environment: 'master',
environment: CONTENTFUL_ENVIRONMENT,
host: CONTENTFUL_HOST,
},
},
'gatsby-source-lever': {
Expand Down

0 comments on commit 5026e9a

Please sign in to comment.