Merge pull request #11 from hayato-osh/dependabot/npm_and_yarn/vite-5… #14
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
on: [push] | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
deployments: write | |
name: Publish to Cloudflare Pages | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
- name: Cache npm directory | |
uses: actions/cache@v3 | |
with: | |
# CIでキャッシュするディレクトリやファイルのパス | |
path: ~/.npm | |
# キャッシュを保存・復元する際のキー | |
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} | |
# キーで指定したキャッシュがヒットしなかった際に代理として使用されるキー | |
restore-keys: ${{ runner.os }}-npm- | |
- name: Install node modules | |
run: npm ci | |
- name: Build app | |
run: npm run build | |
- name: Publish to Cloudflare Pages | |
uses: cloudflare/pages-action@v1 | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
projectName: blog | |
directory: ./dist | |
# Optional: Enable this if you want to have GitHub Deployments triggered | |
gitHubToken: ${{ secrets.GITHUB_TOKEN }} | |
# Optional: Switch what branch you are publishing to. | |
# By default this will be the branch which triggered this workflow | |
branch: main | |
# Optional: Change the Wrangler version, allows you to point to a specific version or a tag such as `beta` | |
wranglerVersion: '3' |