From 0adfc178570abae09a76544784ed62109b93e207 Mon Sep 17 00:00:00 2001 From: Lei OT Date: Wed, 4 Feb 2026 10:21:57 +0800 Subject: [PATCH] ci: github actions --- .github/workflows/deploy-GHH.yml | 57 ++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/deploy-GHH.yml diff --git a/.github/workflows/deploy-GHH.yml b/.github/workflows/deploy-GHH.yml new file mode 100644 index 0000000..f709eac --- /dev/null +++ b/.github/workflows/deploy-GHH.yml @@ -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