Skip to content

Commit

Permalink
chore: use github deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
harukiinharu committed Jan 17, 2025
1 parent 9ccf8c4 commit 3aa83b4
Show file tree
Hide file tree
Showing 3 changed files with 358 additions and 284 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Deploy

on:
push:
branches:
- main

permissions:
contents: read
pages: write
id-token: write

jobs:
build:
timeout-minutes: 20
runs-on: ubuntu-latest
steps:
- name: Check out repo's default branch
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0

- uses: pnpm/action-setup@v4
name: Install pnpm
id: pnpm-install
with:
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install

- name: Build
run: pnpm b

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: dist

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
13 changes: 6 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,18 @@
"scripts": {
"d": "vite --open",
"b": "vite build",
"p": "vite preview",
"p-static": "npx http-server dist -a 127.0.0.1 -p 3001"
"p": "npx http-server dist -a 127.0.0.1 -p 3001"
},
"dependencies": {
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-router": "^7.0.2"
"react-router": "^7.1.2"
},
"devDependencies": {
"@types/react": "^19.0.1",
"@types/react-dom": "^19.0.2",
"@types/react": "^19.0.7",
"@types/react-dom": "^19.0.3",
"@vitejs/plugin-react": "^4.3.4",
"typescript": "^5.7.2",
"vite": "^6.0.3"
"typescript": "^5.7.3",
"vite": "^6.0.7"
}
}
Loading

0 comments on commit 3aa83b4

Please sign in to comment.