@@ -5,8 +5,8 @@ name: Full-Site-Build
55# Controls when the workflow will run
66on :
77 # Triggers the workflow on push events but only for the master branch
8- push :
9- branches : [ preview ]
8+ # push:
9+ # branches: [ preview ]
1010
1111 # Allows you to run this workflow manually from the Actions tab
1212 workflow_dispatch :
@@ -30,14 +30,24 @@ jobs:
3030 cd /home/ubuntu
3131 [ -d DDNDoc ] && rm -rf DDNDoc
3232 [ ! -d DDNDoc ] && mkdir -p DDNDoc
33- [ -d document-normalizer-docs ] && rm -rf document-normalizer-docs
34- mkdir -p document-normalizer-docs
35- git clone --depth 1 --branch main https://github.com/dynamsoft-docs/document-normalizer-docs.git document-normalizer-docs
36- cp -rfp ./document-normalizer-docs/* ./DDNDoc/
37- cd Docs-Template-Repo && git pull && cd .. && cp -rfp ./Docs-Template-Repo/* ./DDNDoc/
33+ [ ! -d document-normalizer-docs ] && git clone --depth 1 https://github.com/dynamsoft-docs/document-normalizer-docs.git document-normalizer-docs
34+ [ ! -d Docs-Template-Repo-Preview ] && git clone --depth 1 --branch preview https://github.com/dynamsoft-docs/Docs-Template-Repo.git Docs-Template-Repo-Preview
35+ cd document-normalizer-docs && git pull && cd .. && cp -rfp ./document-normalizer-docs/* ./DDNDoc/
36+ cd Docs-Template-Repo-Preview && git pull && cd .. && cp -rfp ./Docs-Template-Repo-Preview/* ./DDNDoc/
3837 cd DDNDoc && bundle exec jekyll build
39- python3 /home/ubuntu/ftp.py /home/ubuntu/DDNDoc/_site/ ./www.dynamsoft.com/document-normalizer/docs/ prod
40-
38+ #python3 /home/ubuntu/ftp.py /home/ubuntu/DDNDoc/_site/ ./www.dynamsoft.com/document-normalizer/docs/ prod
39+
40+ - name : Sync files
41+ uses :
SamKirkland/[email protected] 42+ with :
43+ server : ${{ secrets.FTP_DYNAMSOFT_LOCAL_SERVER }}
44+ username : ${{ secrets.FTP_DYNAMSOFT_LOCAL_USER }}
45+ password : ${{ secrets.FTP_DYNAMSOFT_LOCAL_PASSWORD }}
46+ port : 21
47+ local-dir : /home/ubuntu/DDNDoc/_site/
48+ server-dir : /www.dynamsoft.com/document-normalizer/docs/
49+
50+
4151 Build-Preview :
4252 if : ${{ github.ref == 'refs/heads/preview' }}
4353 # The type of runner that the job will run on
@@ -55,15 +65,14 @@ jobs:
5565 cd /home/ubuntu
5666 [ -d DDNDocPreview ] && rm -rf DDNDocPreview
5767 [ -d document-normalizer-docs-preview ] && rm -rf document-normalizer-docs-preview
58- mkdir -p DDNDocPreview
59- git clone --depth 1 --branch preview https://github.com/dynamsoft-docs/document-normalizer-docs.git document-normalizer-docs-preview
60- cp -rfp ./document-normalizer-docs-preview/* ./DDNDocPreview/
61- cd Docs-Template-Repo && git pull && cd .. && cp -rfp ./Docs-Template-Repo/* ./DDNDocPreview/
68+ [ ! -d DDNDocPreview ] && mkdir -p DDNDocPreview
69+ [ ! -d document-normalizer-docs-preview ] && git clone --depth 1 --branch preview https://github.com/dynamsoft-docs/document-normalizer-docs.git document-normalizer-docs-preview
70+ cd document-normalizer-docs-preview && git pull && cd .. && cp -rfp ./document-normalizer-docs-preview/* ./DDNDocPreview/
71+ cd Docs-Template-Repo-Preview && git pull && cd .. && cp -rfp ./Docs-Template-Repo-Preview /* ./DDNDocPreview/
6272 sed -i -e "1,3s/blob\/master$/blob\/preview/" \
6373 -e "1,3s/blob\/main$/blob\/preview/" /home/ubuntu/DDNDocPreview/_config.yml
64- cd DDNDocPreview && bundle exec jekyll build #--incremental
74+ cd DDNDocPreview && bundle exec jekyll build
6575
66-
6776 - name : Sync files
6877 uses :
SamKirkland/[email protected] 6978 with :
0 commit comments