Skip to content

Commit

Permalink
デプロイ処理を改修
Browse files Browse the repository at this point in the history
  • Loading branch information
0maru committed Jul 9, 2024
1 parent 2165ad0 commit 3c2a2a6
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 27 deletions.
1 change: 1 addition & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx lint-staged
18 changes: 18 additions & 0 deletions .github/actions/setup-node/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Setup Node
description: 'Set up Node.js and install dependencies'
runs:
using: "composite"
steps:
- uses: pnpm/action-setup@v2
with:
version: 9.4.0
run_install: false
- uses: actions/setup-node@v4
with:
node-version-file: ".tool-versions"
cache: pnpm
cache-dependency-path: "pnpm-lock.yaml"
- run: pnpm bootstrap
shell: bash
- run: pnpm i
shell: bash
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: ci

on:
pull_request:
branches:
- main
push:
branches:
- main
permissions:
contents: read
deployments: write
jobs:
lint:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-node
- run: pnpm lint
- run: npx biome check .
28 changes: 1 addition & 27 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,35 +16,9 @@ jobs:
steps:
- name: Checkout commit
uses: actions/checkout@v3

- name: SetUp Node.js
uses: actions/setup-node@v3
with:
node-version: '22.3.0'

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 9.4.0
run_install: false

- name: Get pnpm store directory
shell: bash
run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-pnpm-store-

- name: Install dependencies
run: pnpm install

- uses: ./.github/actions/setup-node
- name: Build Astro
run: pnpm build

- name: Cloudflare Pages Deploy
uses: cloudflare/pages-action@v1
with:
Expand Down

0 comments on commit 3c2a2a6

Please sign in to comment.