feat: gh actions #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Delopy Website | |
on: [push, workflow_dispatch] | |
permissions: write-all | |
jobs: | |
Build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: ⏰Set time zone | |
uses: szenius/set-timezone@v1.0 | |
with: | |
timezoneLinux: 'Asia/Shanghai' | |
- name: Check out Git Repository | |
uses: actions/checkout@v4 | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
- name: Cache NPM Dependencies | |
uses: actions/cache@v4 | |
with: | |
path: node_modules | |
key: ${{ runner.OS }}-npm-cache | |
restore-keys: | | |
${{ runner.OS }}-npm-cache | |
- name: Install Dependencies | |
run: | | |
npm i -g pnpm | |
pnpm i | |
- name: Build | |
run: pnpm run build | |
- name: 📂 FTP Deploy | |
uses: SamKirkland/FTP-Deploy-Action@v4.3.5 | |
with: | |
server: ${{ secrets.FTP_SERVER }} | |
username: ${{ secrets.FTP_USERNAME }} | |
password: ${{ secrets.FTP_PASSWORD }} | |
local-dir: ./docs/.vuepress/dist/ | |
server-dir: ./future.mcsl.com.cn/ | |
log-level: verbose | |
port: ${{ secrets.FTP_PORT }} | |
exclude: | | |
**/.git* | |
**/.git*/** | |
**/node_modules/** |