Skip to content

Commit

Permalink
chore: build
Browse files Browse the repository at this point in the history
  • Loading branch information
aisen60 committed May 22, 2024
1 parent 61a3571 commit 79e50cc
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 13 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/deploy-site-to-server.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Deploy Site To Server

on:
workflow_dispatch:
push:
branches: [main]

jobs:
main-branch-deploy:
if: github.repository == 'Aisen60/vant-theme'
runs-on: ubuntu-latest
env:
# 设置时区环境变量
TZ: Asia/Shanghai
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- name: Deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SECRETS_HOST }}
port: ${{ secrets.SECRETS_PORT }}
username: ${{ secrets.SECRETS_USERNAME }}
password: ${{ secrets.SECRETS_PASSWORD }}
script: |
cd /opt/cxs/vant-theme
git checkout .
git pull origin main
pnpm install
npm run build
14 changes: 1 addition & 13 deletions .github/workflows/deploy-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,23 +51,11 @@ jobs:
run: pnpm install

- name: Build project
run: npm run build
run: npm run build:gh-pages

- name: Deploy gh page
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/main' }}
with:
github_token: ${{ secrets.TOKEN_GH_PAGES }}
publish_dir: ./dist

- name: Sync Server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SECRETS_HOST }}
port: ${{ secrets.SECRETS_PORT }}
username: ${{ secrets.SECRETS_USERNAME }}
password: ${{ secrets.SECRETS_PASSWORD }}
script: |
cd /opt/cxs/vant-theme
git checkout .
git pull origin gh-pages

0 comments on commit 79e50cc

Please sign in to comment.