123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- name: deploy
- on:
- push:
- branches:
- - main
- jobs:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- push-to-gh-pages:
- runs-on: ubuntu-latest
- steps:
- - name: Checkout
- uses: actions/checkout@v3
- - name: Sed Config Base
- shell: bash
- run: |
- 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: Install pnpm
- uses: pnpm/action-setup@v2
- with:
- version: 8
- run_install: false
- - name: use Node.js 16
- uses: actions/setup-node@v3
- with:
- node-version: '20.x'
- - name: Set SSH Environment
- env:
- DOCS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
- run: |
- mkdir -p ~/.ssh/
- echo "$ACTIONS_DEPLOY_KEY" > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- ssh-keyscan github.com > ~/.ssh/known_hosts
- chmod 700 ~/.ssh && chmod 600 ~/.ssh/*
- git config --global user.email "vbenadmin@163.com"
- git config --global user.name "vbenAdmin"
- - name: Build
- env:
- NODE_OPTIONS: '--max_old_space_size=4096'
- run: |
- pnpm install --no-frozen-lockfile
- pnpm build
- touch dist/.nojekyll
- cp dist/index.html dist/404.html
- - name: Delete gh-pages branch
- run: |
- git push origin --delete gh-pages
- - name: Deploy
- uses: peaceiris/actions-gh-pages@v3.9.0
- with:
- deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
- PUBLISH_BRANCH: gh-pages
- PUBLISH_DIR: ./dist
- CNAME: vben.vvbin.cn
|