ci: github actions

main
Lei OT 2 months ago
parent 4aef373dea
commit 0adfc17857

@ -0,0 +1,57 @@
# Build & deploy
name: 🚀 Deploy GHH
on:
push:
tag:
- 'v*'
jobs:
build:
name: 🎉 Deploy
runs-on: ubuntu-latest
steps:
- name: 🚚 Get latest code
uses: actions/checkout@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: '20'
cache: "npm"
- name: 🔨 Build Project
run: |
npm install
npm run build --if-present
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: fe-build
path: |
dist
build
out
if-no-files-found: ignore
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: fe-build
path: ./build-output
- name: 📂 Sync files
uses: SamKirkland/FTP-Deploy-Action@v4.3.4
with:
server: ${{ secrets.GHH_SERVER }}
username: ${{ secrets.GHH_USER }}
password: ${{ secrets.GHH_PASSWORD }}
port: ${{ secrets.GHH_PORT }}
local-dir: ./build-output
server-dir: ${{ secrets.GHH_PATH }}
# dangerous-clean-slate: true # deletes remote files before upload
Loading…
Cancel
Save