This commit is contained in:
@@ -9,29 +9,20 @@ jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 10
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Build site
|
||||
run: pnpm run build
|
||||
|
||||
- name: Deploy to server
|
||||
- name: Deploy blog
|
||||
run: |
|
||||
echo "Deploying built site..."
|
||||
cd /tmp
|
||||
rm -rf blog-build
|
||||
git clone http://192.168.0.14:3000/jawhng/jawhng-blog.git blog-build
|
||||
cd blog-build
|
||||
|
||||
export NVM_DIR="/home/jawhng/.nvm"
|
||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
|
||||
|
||||
pnpm install --frozen-lockfile
|
||||
pnpm run build
|
||||
|
||||
rm -rf /deploy/blog/*
|
||||
cp -r build/* /deploy/blog/
|
||||
echo "✅ Blog deployed successfully!"
|
||||
|
||||
echo "✅ Blog deployed successfully at $(date)"
|
||||
|
||||
Reference in New Issue
Block a user