tailwind-nextjs-blog/.github/workflows/build-and-deploy-by-ftp.yaml
Ivan Li ff13b8b2b2
All checks were successful
🚀 Build and deploy by ftp / 🎉 Deploy (push) Successful in 3m40s
build: ftp path.
2023-07-09 15:04:42 +00:00

67 lines
1.5 KiB
YAML

name: 🚀 Build and deploy by ftp
on:
push:
branches:
- master
- main
jobs:
ftp-build-and-deploy:
name: 🎉 Deploy
runs-on: ubuntu-latest
steps:
- name: 🚚 Get latest code
uses: https://github.com/actions/checkout@v3
- uses: https://github.com/actions/setup-node@v3
with:
node-version: 18
- uses: https://github.com/pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
version: 8
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/setup-go@v3
with:
go-version: '1.20'
- uses: actions/go-hashfiles@v0.0.1
id: get-hash
with:
patterns: |-
go.sum
**/pnpm-lock.yaml
- uses: https://github.com/actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ steps.get-hash.outputs.hash }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- run: pnpm build
- run: npm run export
- name: 📂 Sync files
uses: https://github.com/SamKirkland/FTP-Deploy-Action@v4.3.4
with:
server: ${{ secrets.ftp_server }}
username: ${{ secrets.ftp_username }}
password: ${{ secrets.ftp_password }}
server-dir: ./WEB/
local-dir: ./out/