Skip to content

Commit

Permalink
chore: github page deploy μ„€μ •
Browse files Browse the repository at this point in the history
  • Loading branch information
chan9yu committed Oct 5, 2024
1 parent f396cba commit 8cbcd57
Show file tree
Hide file tree
Showing 4 changed files with 254 additions and 8 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Deploy static content to Pages

on:
push:
branches: ['main']
pull_request:
branches: ['main']

permissions:
contents: write

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Use Node.js πŸ’Ύ
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
- name: Install Dependencies And Build πŸ”§
run: pnpm install --frozen-lockfile && pnpm build
- name: Deploy with gh-pages πŸ“¦
run: |
git config --global user.email "[email protected]"
git config --global user.name "chan9yu"
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
pnpm run deploy -- -u "github-actions-bot <[email protected]>"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"description": "πŸ§‘πŸ»β€πŸ’» infinite scroll challenge with React",
"packageManager": "[email protected]",
"author": "chan9yu <[email protected]>",
"homepage": "https://chan9yu.github.io/infinite-scroll-challenge/",
"repository": {
"type": "git",
"url": "https://github.com/chan9yu/infinite-scroll-challenge"
Expand All @@ -14,7 +15,8 @@
"dev": "vite",
"build": "tsc -b && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
"preview": "vite preview",
"deploy": "gh-pages -d dist"
},
"dependencies": {
"debug": "^4.3.7",
Expand All @@ -37,6 +39,7 @@
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-refresh": "^0.4.8",
"eslint-plugin-storybook": "^0.8.0",
"gh-pages": "^6.1.1",
"postcss": "^8.4.47",
"prettier": "^3.3.3",
"tailwindcss": "^3.4.13",
Expand Down
Loading

0 comments on commit 8cbcd57

Please sign in to comment.