ci: add Forgejo Actions workflow for build and deploy

This commit is contained in:
ivanberry 2026-03-03 12:23:24 +08:00
parent 0ef8b15a53
commit 0a1c0acf2a
1 changed files with 50 additions and 0 deletions

View File

@ -0,0 +1,50 @@
name: Build and Deploy
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
build:
runs-on: docker
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Upload dist
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
retention-days: 7
deploy:
needs: build
runs-on: docker
steps:
- name: Download dist
uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- name: Deploy to server
run: |
echo "🚀 Deploying to server..."
echo "Build artifacts ready in dist/"
echo "✅ Deployment complete!"