forked from PanJiaChen/vue-element-admin
-
Notifications
You must be signed in to change notification settings - Fork 48
71 lines (61 loc) · 2.21 KB
/
docs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
# This file was contributed by Carlos Parada and Yamel Senih from ERP Consultores y Asociados, C.A
name: Deploy Documentation on Github Pages
# Controls when the action will run.
on:
push:
branches:
# Push events on master and develop branchs
- main
- master
- develop
- experimental
# takes only the directory changes
paths:
- 'docs/**'
- .github/workflows/docs.yml
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
name: Build and deploy ADempiere-Vue docs
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Node configuration
uses: actions/setup-node@v3
with:
node-version: 14.x
cache: 'yarn'
- name: Enable https to install packages
run: git config --global url."https://".insteadOf git://
- name: Generate static vuepress files
run: |
cd docs
yarn ci
yarn build
- name: Upload dist docs
uses: actions/upload-artifact@v3
with:
name: adempiere-vue-docs
path: docs/.vuepress/dist
- name: Init new repo in dist folder and commit generated files
run: |
cd docs/.vuepress/dist
touch .nojekyll
git init
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add -A
git commit -m "docs: ${{ github.event.head_commit.message }}" -a || true
- name: Force push to destination branch
uses: ad-m/[email protected]
with:
branch: gh-pages
force: true
directory: docs/.vuepress/dist
github_token: ${{ secrets.GITHUB_TOKEN }}