re:Invent #142
This file contains hidden or 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@427ee2cf860166e404d0d69b4f2b24012bb7af4f # v2.2.3 | |
| publish: | |
| timeout-minutes: 17 | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| deployments: write | |
| env: | |
| LANG: ja_JP.UTF-8 | |
| name: Publish to Cloudflare Pages | |
| steps: | |
| - name: ja_JP.UTF-8 | |
| run: | | |
| sudo locale-gen ja_JP.UTF-8 | |
| sudo update-locale LANG=ja_JP.UTF-8 | |
| - 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@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 | |
| with: | |
| path: ~/.cache/deno | |
| key: deno-${{ github.job }}-${{ hashFiles('deno.lock') }} | |
| restore-keys: | | |
| deno-${{ github.job }}- | |
| - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 | |
| with: | |
| path: _cache | |
| key: lumecache-${{ github.job }}-${{ hashFiles('deno.lock') }} | |
| restore-keys: | | |
| lumecache-${{ github.job }}- | |
| - uses: denoland/setup-deno@909cc5acb0fdd60627fb858598759246509fa755 # v2.0.2 | |
| - name: Generate raw YAML for build | |
| run: deno task sync | |
| - name: Build blog | |
| run: deno task build | |
| - name: Set Content-Type header | |
| run: | | |
| echo "/feed.rss\n Content-Type: application/xml" >> _site/_headers | |
| - name: Install Wrangler | |
| run: deno install --global --allow-scripts npm:wrangler@latest | |
| - name: Publish to Cloudflare Pages | |
| uses: cloudflare/wrangler-action@da0e0dfe58b7a431659754fdf3f186c529afbe65 # v3.14.1 | |
| with: | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| command: pages deploy _site --project-name=${{ secrets.CLOUDFLARE_PAGES_PROJECT_NAME }} |