123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- name: schedule-push-to-ftp
- # Timed deployment project
- on:
- push:
- schedule:
- - cron: '0 20 * * *'
- jobs:
- schedule-push-to-ftp:
- runs-on: ubuntu-latest
- steps:
- - name: Checkout
- uses: actions/checkout@v3
- - name: Sed Config Base
- shell: bash
- run: |
- sed -i 's#VITE_PUBLIC_PATH\s*=.*#VITE_PUBLIC_PATH = /next/#g' ./.env.production
- sed -i "s#VITE_BUILD_COMPRESS\s*=.*#VITE_BUILD_COMPRESS = 'gzip'#g" ./.env.production
- sed -i "s#VITE_DROP_CONSOLE\s*=.*#VITE_DROP_CONSOLE = true#g" ./.env.production
- cat ./.env.production
- - name: use Node.js 16
- uses: actions/setup-node@v3
- with:
- node-version: 16
- - name: Get yarn cache
- id: yarn-cache
- run: echo "::set-output name=dir::$(yarn cache dir)"
- - name: Cache dependencies
- uses: actions/cache@v3
- with:
- path: ${{ steps.yarn-cache.outputs.dir }}
- key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- restore-keys: |
- ${{ runner.os }}-yarn-
- - name: Build
- run: |
- yarn install
- yarn run build
- - name: Deploy
- uses: SamKirkland/FTP-Deploy-Action@4.3.2
- with:
- server: ${{ secrets.FTP_SERVER }}
- username: ${{ secrets.FTP_USERNAME }}
- password: ${{ secrets.FTP_PASSWORD }}
- protocol: ftps
- port: ${{ secrets.FTP_PORT }}
- local-dir: ./dist/
- server-dir: ./srv/www/vben-admin/
- timeout: 60000
- # ARGS: --delete --verbose --parallel=80
|