@@ -18,79 +18,16 @@ jobs:
1818 # This workflow contains jobs called "Build-Main" and "Build-Preview"
1919 Build-Main :
2020 if : ${{ github.ref == 'refs/heads/main' }}
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 DDNDoc ] && rm -rf DDNDoc
34- [ -d document-normalizer-docs ] && rm -rf document-normalizer-docs
35- [ -d Docs-Template-Repo-Preview ] && rm -rf Docs-Template-Repo-Preview
36- [ ! -d DDNDoc ] && mkdir -p DDNDoc
37- git clone --depth 1 https://github.com/dynamsoft-docs/document-normalizer-docs.git document-normalizer-docs
38- git clone --depth 1 --branch preview https://github.com/dynamsoft-docs/Docs-Template-Repo.git Docs-Template-Repo-Preview
39- cp -rfp ./document-normalizer-docs/* ./DDNDoc/
40- cp -rfp ./Docs-Template-Repo-Preview/* ./DDNDoc/
41- cd DDNDoc && bundle install && bundle exec jekyll build
42-
43- - name : Sync files
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/DDNDoc/_site/
51- server-dir : /www.dynamsoft.com/document-normalizer/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 "[\"/document-normalizer/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 : document-normalizer-docs
24+ doc-url : document-normalizer/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 DDNDocPreview ] && rm -rf DDNDocPreview
70- [ -d document-normalizer-docs-preview ] && rm -rf document-normalizer-docs-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 DDNDocPreview ] && mkdir -p DDNDocPreview
78- git clone --depth 1 --branch preview https://github.com/dynamsoft-docs/document-normalizer-docs.git document-normalizer-docs-preview
79- git clone --depth 1 --branch preview https://github.com/dynamsoft-docs/Docs-Template-Repo.git Docs-Template-Repo-Preview
80- cp -rfp ./document-normalizer-docs-preview/* ./DDNDocPreview/
81- cp -rfp ./Docs-Template-Repo-Preview/* ./DDNDocPreview/
82- sed -i -e "1,3s/blob\/master$/blob\/preview/" \
83- -e "1,3s/blob\/main$/blob\/preview/" /home/ubuntu/DDNDocPreview/_config.yml
84- cd DDNDocPreview && 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/DDNDocPreview/_site/
94- server-dir : /www.dynamsoft.com/document-normalizer/docs/core/
95-
96-
29+ uses : dynamsoft-docs/Docs-Template-Repo/.github/workflows/called-workflow-build-sync-testing.yml@preview
30+ with :
31+ doc-repo : document-normalizer-docs
32+ doc-url : document-normalizer/docs/core
33+ secrets : inherit
0 commit comments