mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 18:35:51 +02:00
chore: add build and deploy action for documents
This commit is contained in:
parent
20ad17bbfa
commit
c35433f235
2 changed files with 67 additions and 2 deletions
9
.github/workflows/build.yml
vendored
9
.github/workflows/build.yml
vendored
|
@ -12,8 +12,10 @@ on:
|
||||||
- "**/*.go"
|
- "**/*.go"
|
||||||
- "go.mod"
|
- "go.mod"
|
||||||
- "go.sum"
|
- "go.sum"
|
||||||
- ".github/workflows/*.yml"
|
- ".github/workflows/build*.yml"
|
||||||
- "resources/*"
|
- "resources/docker/docker/*"
|
||||||
|
- "resources/development/*"
|
||||||
|
- "resources/demo/*"
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [ opened, synchronize, reopened ]
|
types: [ opened, synchronize, reopened ]
|
||||||
paths:
|
paths:
|
||||||
|
@ -25,6 +27,9 @@ on:
|
||||||
- "go.mod"
|
- "go.mod"
|
||||||
- "go.sum"
|
- "go.sum"
|
||||||
- ".github/workflows/*.yml"
|
- ".github/workflows/*.yml"
|
||||||
|
- "resources/docker/docker/*"
|
||||||
|
- "resources/development/*"
|
||||||
|
- "resources/demo/*"
|
||||||
release:
|
release:
|
||||||
types:
|
types:
|
||||||
- published
|
- published
|
||||||
|
|
60
.github/workflows/documents.yml
vendored
Normal file
60
.github/workflows/documents.yml
vendored
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
name: Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- '*'
|
||||||
|
paths:
|
||||||
|
- "docs/**/*.js"
|
||||||
|
- "docs/**/*.ts"
|
||||||
|
- "docs/**/*.vue"
|
||||||
|
- "docs/package.json"
|
||||||
|
- "docs/.env*"
|
||||||
|
- ".github/workflows/doc*.yml"
|
||||||
|
pull_request:
|
||||||
|
types: [ opened, synchronize, reopened ]
|
||||||
|
paths:
|
||||||
|
- "docs/**/*.js"
|
||||||
|
- "docs/**/*.ts"
|
||||||
|
- "docs/**/*.vue"
|
||||||
|
- "docs/package.json"
|
||||||
|
- "docs/.env*"
|
||||||
|
- ".github/workflows/doc*.yml"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up nodejs
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: 18.x
|
||||||
|
cache: 'yarn'
|
||||||
|
cache-dependency-path: 'docs/yarn.lock'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: yarn install
|
||||||
|
working-directory: docs
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: yarn docs:build
|
||||||
|
working-directory: docs
|
||||||
|
|
||||||
|
- name: Archive artifacts
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: dist
|
||||||
|
path: docs/.vitepress/dist
|
||||||
|
|
||||||
|
- name: Deploy to server
|
||||||
|
uses: easingthemes/ssh-deploy@main
|
||||||
|
env:
|
||||||
|
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
|
||||||
|
REMOTE_USER: ${{ secrets.REMOTE_USER }}
|
||||||
|
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
|
TARGET: ${{ secrets.REMOTE_TARGET }}
|
||||||
|
SOURCE: "docs/.vitepress/dist/"
|
||||||
|
ARGS: "-rlgoDzvc -i --delete"
|
Loading…
Add table
Add a link
Reference in a new issue