You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
1.3 KiB
YAML
58 lines
1.3 KiB
YAML
# Build & deploy
|
|
name: 🚀 Deploy GHH
|
|
on:
|
|
push:
|
|
tags:
|
|
- '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
|