Skip to content

Commit

Permalink
Merge pull request #281 from maretol/add-cms-webhook
Browse files Browse the repository at this point in the history
Add cms webhook
  • Loading branch information
maretol authored Jan 19, 2025
2 parents b1bc54a + 5e477bd commit 9821798
Show file tree
Hide file tree
Showing 20 changed files with 614 additions and 218 deletions.
38 changes: 37 additions & 1 deletion .github/workflows/deploy_dryrun.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:

env:
NODE_VERSION: 20.16.0
WRANGLER_VERSION: 3.99.0

jobs:
changes:
Expand All @@ -29,12 +30,16 @@ jobs:
pages:
- "pages/**"
- "packages/api-types/**"
- "packages/cms-cache-key-gen/**"
ogp-data-fetcher:
- "ogp-data-fetcher/**"
- "packages/api-types/src/ogp_types.ts"
cms-data-fetcher:
- "cms-data-fetcher/**"
- "packages/api-types/src/cms_types.ts"
cms-cache-purger:
- "cms-cache-purger/**"
- "packages/cms-cache-key-gen/**"
workflow:
- ".github/workflows/**"
Expand Down Expand Up @@ -80,6 +85,7 @@ jobs:
id: deploy-dry
uses: cloudflare/wrangler-action@v3
with:
wranglerVersion: ${{ env.WRANGLER_VERSION }}
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
workingDirectory: ./ogp-data-fetcher
Expand Down Expand Up @@ -108,6 +114,7 @@ jobs:
id: deploy
uses: cloudflare/wrangler-action@v3
with:
wranglerVersion: ${{ env.WRANGLER_VERSION }}
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
workingDirectory: ./cms-data-fetcher
Expand All @@ -117,8 +124,37 @@ jobs:
CMD_OUTPUT: ${{ steps.deploy.outputs.command-output }}
run: echo $CMD_OUTPUT

deploy-dry-cms-cache-purger:
needs: changes
if: ${{ needs.changes.outputs.cms-cache-purger == 'true' || needs.changes.outputs.workflow == 'true' }}
runs-on: ubuntu-latest
environment:
name: stg
defaults:
run:
working-directory: ./cms-cache-purger
steps:
- uses: actions/checkout@v4
- name: setup node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: deploy dry run by wrangler
id: deploy
uses: cloudflare/wrangler-action@v3
with:
wranglerVersion: ${{ env.WRANGLER_VERSION }}
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
workingDirectory: ./cms-cache-purger
command: deploy -e staging --config wrangler.toml --dry-run
- name: show done command
env:
CMD_OUTPUT: ${{ steps.deploy.outputs.command-output }}
run: echo $CMD_OUTPUT

status:
needs: [build-pages, deploy-dry-ogp-data-fetcher, deploy-dry-cms-data-fetcher]
needs: [build-pages, deploy-dry-ogp-data-fetcher, deploy-dry-cms-data-fetcher, deploy-dry-cms-cache-purger]
if: always()
runs-on: ubuntu-latest
environment:
Expand Down
36 changes: 35 additions & 1 deletion .github/workflows/deploy_prd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:
- 'pages/**'
- 'ogp-data-fetcher/**'
- 'cms-data-fetcher/**'
- 'cms-cache-purger/**'
- 'packages/**'
- '.github/workflows/deploy_prd.yaml'

env:
Expand All @@ -33,12 +35,16 @@ jobs:
pages:
- "pages/**"
- "packages/api-types/**"
- "packages/cms-cache-key-gen/**"
ogp-data-fetcher:
- "ogp-data-fetcher/**"
- "packages/api-types/src/ogp_types.ts"
cms-data-fetcher:
- "cms-data-fetcher/**"
- "packages/api-types/src/cms_types.ts"
cms-cache-purger:
- "cms-cache-purger/**"
- "packages/cms-cache-key-gen/**"
workflow:
- ".github/workflows/**"
Expand Down Expand Up @@ -132,8 +138,36 @@ jobs:
CMD_OUTPUT: ${{ steps.deploy.outputs.command-output }}
run: echo $CMD_OUTPUT

deploy-cms-cache-purger:
needs: changes
if: ${{ needs.changes.outputs.cms-cache-purger == 'true' || needs.changes.outputs.workflow == 'true' }}
runs-on: ubuntu-latest
environment:
name: prd
defaults:
run:
working-directory: ./cms-cache-purger
steps:
- uses: actions/checkout@v4
- name: setup node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: deploy by wrangler
id: deploy
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
workingDirectory: ./cms-cache-purger
command: deploy
- name: show done command
env:
CMD_OUTPUT: ${{ steps.deploy.outputs.command-output }}
run: echo $CMD_OUTPUT

status:
needs: [deploy-pages, deploy-ogp-data-fetcher, deploy-cms-data-fetcher]
needs: [deploy-pages, deploy-ogp-data-fetcher, deploy-cms-data-fetcher, deploy-cms-cache-purger]
if: always()
runs-on: ubuntu-latest
environment:
Expand Down
38 changes: 37 additions & 1 deletion .github/workflows/deploy_stg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:
- 'pages/**'
- 'ogp-data-fetcher/**'
- 'cms-data-fetcher/**'
- 'cms-cache-purger/**'
- 'packages/**'
- '.github/workflows/deploy_stg.yaml'
- '.github/dependabot.yml'
workflow_call:
Expand Down Expand Up @@ -35,12 +37,16 @@ jobs:
pages:
- "pages/**"
- "packages/api-types/**"
- "packages/cms-cache-key-gen/**"
ogp-data-fetcher:
- "ogp-data-fetcher/**"
- "packages/api-types/src/ogp_types.ts"
cms-data-fetcher:
- "cms-data-fetcher/**"
- "packages/api-types/src/cms_types.ts"
cms-cache-purger:
- "cms-cache-purger/**"
- "packages/cms-cache-key-gen/**"
workflow:
- ".github/workflows/**"
Expand Down Expand Up @@ -138,8 +144,38 @@ jobs:
CMD_OUTPUT: ${{ steps.deploy.outputs.command-output }}
run: echo $CMD_OUTPUT

deploy-cms-cache-purger:
needs: changes
if: ${{ needs.changes.outputs.cms-cache-purger == 'true' || needs.changes.outputs.workflow == 'true' }}
runs-on: ubuntu-latest
environment:
name: stg
defaults:
run:
working-directory: ./cms-cache-purger
steps:
- uses: actions/checkout@v4
- name: setup node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: pwd
run: pwd
- name: deploy by wrangler
id: deploy
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
workingDirectory: ./cms-cache-purger
command: deploy -e staging --config wrangler.toml
- name: show done command
env:
CMD_OUTPUT: ${{ steps.deploy.outputs.command-output }}
run: echo $CMD_OUTPUT

status:
needs: [deploy-pages, deploy-ogp-data-fetcher, deploy-cms-data-fetcher]
needs: [deploy-pages, deploy-ogp-data-fetcher, deploy-cms-data-fetcher, deploy-cms-cache-purger]
if: always()
runs-on: ubuntu-latest
environment:
Expand Down
12 changes: 12 additions & 0 deletions cms-cache-purger/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# http://editorconfig.org
root = true

[*]
indent_style = tab
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.yml]
indent_style = space
172 changes: 172 additions & 0 deletions cms-cache-purger/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
# Logs

logs
_.log
npm-debug.log_
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)

report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json

# Runtime data

pids
_.pid
_.seed
\*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover

lib-cov

# Coverage directory used by tools like istanbul

coverage
\*.lcov

# nyc test coverage

.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)

.grunt

# Bower dependency directory (https://bower.io/)

bower_components

# node-waf configuration

.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)

build/Release

# Dependency directories

node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)

web_modules/

# TypeScript cache

\*.tsbuildinfo

# Optional npm cache directory

.npm

# Optional eslint cache

.eslintcache

# Optional stylelint cache

.stylelintcache

# Microbundle cache

.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history

.node_repl_history

# Output of 'npm pack'

\*.tgz

# Yarn Integrity file

.yarn-integrity

# dotenv environment variable files

.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)

.cache
.parcel-cache

# Next.js build output

.next
out

# Nuxt.js build / generate output

.nuxt
dist

# Gatsby files

.cache/

# Comment in the public line in if your project uses Gatsby and not Next.js

# https://nextjs.org/blog/next-9-1#public-directory-support

# public

# vuepress build output

.vuepress/dist

# vuepress v2.x temp and cache directory

.temp
.cache

# Docusaurus cache and generated files

.docusaurus

# Serverless directories

.serverless/

# FuseBox cache

.fusebox/

# DynamoDB Local files

.dynamodb/

# TernJS port file

.tern-port

# Stores VSCode versions used for testing VSCode extensions

.vscode-test

# yarn v2

.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.\*

# wrangler project

.dev.vars
.wrangler/
Loading

0 comments on commit 9821798

Please sign in to comment.