Skip to content

Commit 050e945

Browse files
update build
1 parent f9effc3 commit 050e945

File tree

1 file changed

+10
-71
lines changed

1 file changed

+10
-71
lines changed

.github/workflows/main.yml

Lines changed: 10 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -18,77 +18,16 @@ jobs:
1818
# This workflow contains jobs called "Build-Master" and "Build-Preview"
1919
Build-Main:
2020
if: ${{ github.ref == 'refs/heads/master' }}
21-
# The type of runner that the job will run on
22-
runs-on: self-hosted
23-
24-
# Steps represent a sequence of tasks that will be executed as part of the job
25-
steps:
26-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
27-
#- uses: actions/checkout@v2
28-
29-
# Runs a set of commands using the runners shell
30-
- name: Run a multi-line script
31-
run: |
32-
cd /home/ubuntu
33-
[ -d DLRDocCore ] && rm -rf DLRDocCore
34-
[ -d label-recognition-docs ] && rm -rf label-recognition-docs
35-
[ -d Docs-Template-Repo-Preview ] && rm -rf Docs-Template-Repo-Preview
36-
[ ! -d DLRDocCore ] && mkdir -p DLRDocCore
37-
git clone --depth 1 https://github.com/dynamsoft-docs/label-recognition-docs.git label-recognition-docs
38-
git clone --depth 1 --branch preview https://github.com/dynamsoft-docs/Docs-Template-Repo.git Docs-Template-Repo-Preview
39-
cp -rfp ./label-recognition-docs/* ./DLRDocCore/
40-
cp -rfp ./Docs-Template-Repo-Preview/* ./DLRDocCore/
41-
cd DLRDocCore && bundle install && bundle exec jekyll build
42-
43-
- name: Sync files - Main Site
44-
uses: SamKirkland/FTP-Deploy-Action@4.3.0
45-
with:
46-
server: ${{ secrets.FTP_DYNAMSOFT_LOCAL_SERVER }}
47-
username: ${{ secrets.FTP_DYNAMSOFT_LOCAL_USER }}
48-
password: ${{ secrets.FTP_DYNAMSOFT_LOCAL_PASSWORD }}
49-
port: 21
50-
local-dir: /home/ubuntu/DLRDocCore/_site/
51-
server-dir: /www.dynamsoft.com/label-recognition/docs/core/
52-
53-
- name: Trigger Webhook
54-
run: |
55-
curl -X POST -H "${{ secrets.WEBHOOK_USER }}" -H "${{ secrets.WEBHOOK_TOKEN }}" -H "Content-Type: application/json" -d "[\"/label-recognition/docs/core/*\"]" ${{ secrets.WEBHOOK_URL }}
56-
21+
uses: dynamsoft-docs/Docs-Template-Repo/.github/workflows/called-workflow-build-sync-production.yml@main
22+
with:
23+
doc-repo: label-recognition-docs
24+
doc-url: label-recognition/docs/core
25+
secrets: inherit
5726

5827
Build-Preview:
5928
if: ${{ github.ref == 'refs/heads/preview' }}
60-
# The type of runner that the job will run on
61-
runs-on: self-hosted
62-
63-
# Steps represent a sequence of tasks that will be executed as part of the job
64-
steps:
65-
# Runs a set of commands using the runners shell
66-
- name: clear space
67-
run: |
68-
cd /home/ubuntu
69-
[ -d DLRDocCorePreview ] && rm -rf DLRDocCorePreview
70-
[ -d label-recognition-docs-core-preview ] && rm -rf label-recognition-docs-core-preview
71-
[ -d Docs-Template-Repo-Preview ] && rm -rf Docs-Template-Repo-Preview
72-
cd /home/ubuntu
73-
74-
- name: Build the site
75-
run: |
76-
cd /home/ubuntu
77-
[ ! -d DLRDocCorePreview ] && mkdir -p DLRDocCorePreview
78-
git clone --depth 1 --branch preview https://github.com/Dynamsoft-Docs/label-recognition-docs.git label-recognition-docs-core-preview
79-
git clone --depth 1 --branch preview https://github.com/dynamsoft-docs/Docs-Template-Repo.git Docs-Template-Repo-Preview
80-
cp -rfp ./label-recognition-docs-core-preview/* ./DLRDocCorePreview/
81-
cp -rfp ./Docs-Template-Repo-Preview/* ./DLRDocCorePreview/
82-
sed -i -e "1,3s/blob\/master$/blob\/preview/" \
83-
-e "1,3s/blob\/main$/blob\/preview/" /home/ubuntu/DLRDocCorePreview/_config.yml
84-
cd DLRDocCorePreview && bundle install && bundle exec jekyll build
85-
86-
- name: Sync files
87-
uses: SamKirkland/FTP-Deploy-Action@4.3.0
88-
with:
89-
server: ${{ secrets.FTP_TEST_SITE_SERVER }}
90-
username: ${{ secrets.FTP_TEST_SITE_USER }}
91-
password: ${{ secrets.FTP_TEST_SITE_PASSWORD }}
92-
port: 7500
93-
local-dir: /home/ubuntu/DLRDocCorePreview/_site/
94-
server-dir: /www.dynamsoft.com/label-recognition/docs/core/
29+
uses: dynamsoft-docs/Docs-Template-Repo/.github/workflows/called-workflow-build-sync-testing.yml@preview
30+
with:
31+
doc-repo: label-recognition-docs
32+
doc-url: label-recognition/docs/core
33+
secrets: inherit

0 commit comments

Comments
 (0)