CDN 地址更换 #529
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
name: 持续集成 | |
on: push | |
jobs: | |
deploy_to_server: | |
name: 服务器部署 | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/master' | |
steps: | |
- name: 拉取代码 | |
uses: actions/checkout@v2 | |
- name: 安装 Node.js | |
uses: actions/setup-node@v1 | |
with: | |
node-version: "12" | |
- name: 安装 NPM 依赖 | |
run: npm ci | |
- name: 开始编译 | |
run: npm run build | |
- name: 部署上传 | |
uses: easingthemes/[email protected] | |
env: | |
SSH_PRIVATE_KEY: ${{ secrets.SERVER_SSH_KEY }} | |
ARGS: "-rltgoDzvO --delete" | |
SOURCE: "dist/" | |
REMOTE_HOST: ${{ secrets.REMOTE_HOST }} | |
REMOTE_USER: ${{ secrets.REMOTE_USER }} | |
TARGET: ${{ secrets.REMOTE_TARGET }} | |
deploy_to_github_pages: | |
name: Github Pages 部署 | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/master' | |
steps: | |
- name: 拉取代码 | |
uses: actions/checkout@v2 | |
- name: 安装 Node.js | |
uses: actions/setup-node@v1 | |
with: | |
node-version: "12" | |
- name: 安装 NPM 依赖 | |
run: npm ci | |
- name: 修改编译路径 | |
run: | | |
sed -i "s#base: '/',#base: '/lin-ui-doc/',#" docs/.vuepress/config.js | |
- name: 开始编译 | |
run: npm run build | |
- name: 部署 Github Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./dist | |
publish_branch: gh-pages | |
deploy_to_coding_pages: | |
name: Coding Pages 部署 | |
runs-on: ubuntu-latest | |
steps: | |
- name: 拉取代码 | |
uses: actions/checkout@v2 | |
- name: 安装 Node.js | |
uses: actions/setup-node@v1 | |
with: | |
node-version: "12" | |
- name: 安装 NPM 依赖 | |
run: npm ci | |
- name: 开始编译 | |
run: npm run build | |
- name: 部署 master 分支 | |
uses: peaceiris/actions-gh-pages@v3 | |
if: github.ref == 'refs/heads/master' | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./dist | |
publish_branch: coding-pages-${{github.ref}} | |
- name: 部署 develop 分支 | |
uses: peaceiris/actions-gh-pages@v3 | |
if: github.ref == 'refs/heads/develop' | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./dist | |
publish_branch: coding-pages-${{github.ref}} | |
- name: 部署 test 分支 | |
uses: peaceiris/actions-gh-pages@v3 | |
if: startsWith(github.ref,'refs/heads/test/') | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./dist | |
publish_branch: coding-pages-${{github.ref}} | |
async_repository_gitee: | |
name: Gitee 同步 | |
runs-on: ubuntu-latest | |
needs: [deploy_to_github_pages, deploy_to_coding_pages] | |
if: always() | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Gitee 同步 | |
uses: spyoungtech/mirror-action@master | |
with: | |
REMOTE: https://gitee.com/juzi214032/lin-ui-doc.git | |
GIT_USERNAME: juzi214032 | |
GIT_PASSWORD: ${{ secrets.GITEE_TOKEN }} | |
async_repository_coding: | |
name: Coding 同步 | |
runs-on: ubuntu-latest | |
needs: [deploy_to_github_pages, deploy_to_coding_pages] | |
if: always() | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Coding 同步 | |
uses: spyoungtech/mirror-action@master | |
with: | |
REMOTE: https://e.coding.net/juzi214032/lin-ui-doc.git | |
GIT_USERNAME: MJdiuGOEDD | |
GIT_PASSWORD: ${{ secrets.CODING_TOKEN }} |