Skip to content

准备测试环境工作流 #43

准备测试环境工作流

准备测试环境工作流 #43

Workflow file for this run

# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Deploy to FTP
on:
push:
branches: [ testing ]
workflow_dispatch:
jobs:
deploy:
name: 🎉 Deploy
runs-on: ubuntu-latest
steps:
- name: 🚚 Get latest code
uses: actions/checkout@v4
- run: bash .github/workflows/env-builder.sh ${{ secrets.ENV_DEFAULT_CONFIG_URL }} > .env.local
- name: 🔨 Build Project Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- run: npm run test
- run: npm run build --if-present
- name: 📂 Sync files
uses: SamKirkland/FTP-Deploy-Action@v4.3.5
with:
server: ${{ secrets.FTP_HOST }}
username: ${{ secrets.FTP_USERNAME }}
password: ${{ secrets.FTP_PASSWORD }}
local-dir: ./dist/
dangerous-clean-slate: true