-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
63 additions
and
28 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# # node 环境 | ||
# NODE_ENV=production | ||
VITE_BASE=/ | ||
#APP 运行环境 | ||
VITE_APP_ENV=production | ||
# 是否开启 vconsole | ||
VITE_APP_VCONSOLE_ENABLED=true | ||
# 是否启用 gzip 或 brotli 压缩 | ||
# 可选性: gzip | brotli | none | ||
# 如果需要多个,可以使用逗号分隔 | ||
VITE_APP_BUILD_COMPRESS=gzip | ||
# 使用压缩时是否删除源文件,默认为 false | ||
VITE_APP_BUILD_COMPRESS_DELETE_ORIGIN_FILE=false |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Deploy site by main branch to gh pages | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-20.04 | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
steps: | ||
- name: Checkout main branch code | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: main | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '18' | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Build project | ||
run: npm run build | ||
|
||
- name: Deploy gh page | ||
uses: peaceiris/actions-gh-pages@v3 | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
with: | ||
github_token: ${{ secrets.GH_PAGES }} | ||
publish_dir: ./dist |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,23 @@ | ||
name: Deploy Site By main Branch | ||
name: Deploy site by main branch to server | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [main] | ||
schedule: | ||
- cron: "0 21 * * *" | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-20.04 | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
main-branch-deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout main branch code | ||
uses: actions/checkout@v3 | ||
- name: Deploy | ||
uses: appleboy/ssh-action@master | ||
with: | ||
ref: main | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '18' | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Build project | ||
run: npm run build | ||
|
||
- name: Deploy gh page | ||
uses: peaceiris/actions-gh-pages@v3 | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
with: | ||
github_token: ${{ secrets.GH_PAGES }} | ||
publish_dir: ./dist | ||
host: ${{ secrets.HOST }} | ||
port: ${{ secrets.PORT }} | ||
username: ${{ secrets.USERNAME }} | ||
password: ${{ secrets.PASSWORD }} | ||
script: | | ||
cd /opt/cxs/vue3-h5-template | ||
git pull origin main | ||
pnpm install | ||
npm run build:deploy |
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