update actions #76
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: Deploy blog to Cloudflare Pages | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
actions-timeline: | |
timeout-minutes: 11 | |
needs: [publish] | |
runs-on: ubuntu-latest | |
permissions: | |
actions: read | |
steps: | |
- uses: Kesin11/actions-timeline@3046833d9aacfd7745c5264b7f3af851c3e2a619 # v2.2.1 | |
publish: | |
timeout-minutes: 17 | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
deployments: write | |
name: Publish to Cloudflare Pages | |
steps: | |
- name: Set timezone to JST | |
# lume の `log.date | date('DATETIME', 'ja')` が動くにはタイムゾーンを日本に変更する必要がある | |
run: | | |
sudo timedatectl set-timezone Asia/Tokyo | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 | |
with: | |
path: ~/.cache/deno | |
key: deno-${{ github.job }}-${{ hashFiles('deno.lock') }} | |
restore-keys: | | |
deno-${{ github.job }}- | |
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 | |
with: | |
path: _cache | |
key: lumecache-${{ github.job }}-${{ hashFiles('deno.lock') }} | |
restore-keys: | | |
lumecache-${{ github.job }}- | |
- uses: denoland/setup-deno@4606d5cc6fb3f673efd4f594850e3f4b3e9d29cd # v2.0.0 | |
- name: Generate raw YAML for build | |
run: deno task sync | |
- name: Build blog | |
run: deno task build | |
- name: Publish to Cloudflare Pages | |
uses: cloudflare/wrangler-action@6d58852c35a27e6034745c5d0bc373d739014f7f # v3.13.0 | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
command: pages deploy _site --project-name=${{ secrets.CLOUDFLARE_PAGES_PROJECT_NAME }} |