update about link #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish to Cloudflare Pages | |
on: | |
push: | |
workflow_dispatch: | |
schedule: | |
- cron: '55 14 * * *' # 23:55 JST | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
if: github.repository == 'technotut/nextjs-notion-blog' | |
permissions: | |
contents: read | |
deployments: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v3 | |
id: pnpm-install | |
with: | |
version: 9.12.2 | |
run_install: false | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 21 | |
- uses: actions/cache@v3 | |
id: node_modules_cache_id | |
env: | |
cache-name: cache-node-modules | |
with: | |
path: '**/node_modules' | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
- run: echo '${{ toJSON(steps.node_modules_cache_id.outputs) }}' | |
- if: ${{ steps.node_modules_cache_id.outputs.cache-hit != 'true' }} | |
run: pnpm install | |
- name: Build | |
run: pnpm run build | |
- name: Publish to Cloudflare Pages | |
uses: cloudflare/wrangler-action@v3 | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
command: pages deploy out --project-name blog | |
- name: Notify Discord | |
run: | | |
curl -H "Content-Type: application/json" \ | |
-X POST \ | |
-d '{ | |
"content": "デプロイ完了! https://blog.technotut.net/" | |
}' \ | |
${{ secrets.DISCORD_WEBHOOK_URL }} |