diff --git a/.github/workflows/called-workflow-build-sync-production.yml b/.github/workflows/called-workflow-build-sync-production.yml index 696c377..f81d0a5 100644 --- a/.github/workflows/called-workflow-build-sync-production.yml +++ b/.github/workflows/called-workflow-build-sync-production.yml @@ -39,20 +39,20 @@ jobs: server: ${{ secrets.FTP_DYNAMSOFT_LOCAL_SERVER }} username: ${{ secrets.FTP_DYNAMSOFT_LOCAL_USER }} password: ${{ secrets.FTP_DYNAMSOFT_LOCAL_PASSWORD }} - port: 21 + port: 21 local-dir: ${{ runner.temp }}/DocHome/_site/ - server-dir: /www.dynamsoft.com/${{ inputs.doc-url }}/ + server-dir: /www.dynamsoft.com/${{ inputs.doc-url }}/ - - name: Trigger Webhook - run: | + - name: Trigger Webhook + run: | curl -X POST -H "${{ secrets.WEBHOOK_USER }}" -H "${{ secrets.WEBHOOK_TOKEN }}" -H "Content-Type: application/json" -d "[\"/${{ inputs.doc-url }}/*\"]" ${{ secrets.WEBHOOK_URL }} - - name: Update Sitemap - if: startsWith(inputs.doc-url, 'barcode-reader') || - startsWith(inputs.doc-url, 'capture-vision') || - startsWith(inputs.doc-url, 'label-recognition') || - startsWith(inputs.doc-url, 'document-normalizer') || - startsWith(inputs.doc-url, 'code-parser') || + - name: Update Sitemap + if: startsWith(inputs.doc-url, 'barcode-reader') || + startsWith(inputs.doc-url, 'capture-vision') || + startsWith(inputs.doc-url, 'label-recognition') || + startsWith(inputs.doc-url, 'document-normalizer') || + startsWith(inputs.doc-url, 'code-parser') || startsWith(inputs.doc-url, 'camera-enhancer') run: | cd ${{ runner.temp }}/DocHome/assets/scripts/GenerateSitemap diff --git a/.github/workflows/called-workflow-build-sync-testing.yml b/.github/workflows/called-workflow-build-sync-testing.yml index e2897a0..12477e2 100644 --- a/.github/workflows/called-workflow-build-sync-testing.yml +++ b/.github/workflows/called-workflow-build-sync-testing.yml @@ -13,7 +13,6 @@ on: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - Build-Site-Preview: # The type of runner that the job will run on runs-on: [self-hosted, doc-build] @@ -33,11 +32,11 @@ jobs: -e "1,3s/blob\/main$/blob\/preview/" ${{ runner.temp }}/DocHome/_config.yml cd DocHome && bundle install && bundle exec jekyll build - - name: 'Create Tar files' + - name: "Create Tar files" run: tar -czvf ${{ inputs.doc-repo }}.tar.gz -C ${{ runner.temp }}/DocHome/_site . - name: Upload the built site as a single artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v4.6.2 with: name: ${{ inputs.doc-repo }} path: ${{ inputs.doc-repo }}.tar.gz @@ -52,23 +51,23 @@ jobs: steps: # Runs a set of commands using the runners shell - name: Download the artifact - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v4.3.0 with: name: ${{ inputs.doc-repo }} - - name: 'Extract Tar files' + - name: "Extract Tar files" shell: cmd run: | mkdir ${{ runner.temp }}\DocHome\_site tar -xzf ${{ inputs.doc-repo }}.tar.gz -C ${{ runner.temp }}\DocHome\_site - name: Sync files - uses: SamKirkland/FTP-Deploy-Action@4.3.0 + uses: SamKirkland/FTP-Deploy-Action@v4.3.5 with: server: ${{ secrets.FTP_TEST_SITE_SERVER }} username: ${{ secrets.FTP_TEST_SITE_USER }} password: ${{ secrets.FTP_TEST_SITE_PASSWORD }} - port: ${{ secrets.FTP_TEST_SITE_PORT }} + protocol: ftps + port: ${{ secrets.FTP_TEST_SITE_PORT }} local-dir: ${{ runner.temp }}\DocHome\_site/ - server-dir: /www.dynamsoft.com/${{ inputs.doc-url }}/ - + server-dir: /www.dynamsoft.com/${{ inputs.doc-url }}/ diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9ee5626..f319361 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,9 +6,9 @@ name: CI on: # Triggers the workflow on push events push: - branches: - - main - #- preview + branches: + - main + - preview # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -16,6 +16,15 @@ on: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: + # Build and deploy to preview site on push to preview branch + Build-Preview: + if: ${{ github.ref == 'refs/heads/preview' }} + uses: ./.github/workflows/called-workflow-build-sync-testing.yml + with: + doc-repo: ${{ inputs.doc-repo }} + doc-url: ${{ inputs.doc-repo }} + secrets: inherit + Update-DBR-Core-On-Main-Change: if: ${{ github.ref == 'refs/heads/main' }} uses: ./.github/workflows/called-workflow-build-sync-production.yml @@ -287,7 +296,7 @@ jobs: # #- uses: actions/checkout@v2 # # # Runs a set of commands using the runners shell -# +# # - name: Build DNT Doc # run: | # cd /home/ubuntu diff --git a/.gitignore b/.gitignore index 5a05596..9f299ff 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ .DS_Store /.vs -/.history \ No newline at end of file +/.history diff --git a/Gemfile b/Gemfile index f230b5d..368143a 100644 --- a/Gemfile +++ b/Gemfile @@ -10,4 +10,4 @@ gem "jekyll-readme-index", group: :jekyll_plugins gem "jekyll-seo-tag", group: :jekyll_plugins gem "uri" gem "net" -gem "kramdown-parser-gfm" \ No newline at end of file +gem "kramdown-parser-gfm" diff --git a/_includes/auto-version-list.html b/_includes/auto-version-list.html index d773deb..374ab6d 100644 --- a/_includes/auto-version-list.html +++ b/_includes/auto-version-list.html @@ -13,7 +13,7 @@ {%- else -%} {%- assign validVerInfo = site.data.product_version.version_info_list -%} {%- endif -%} - + {%- if site.data.product_version.useGroupedVersion -%} {%- for verInfo in validVerInfo -%} {%- assign curVerText = "" -%} diff --git a/_includes/head.html b/_includes/head.html index 54c9c31..eb34329 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -30,7 +30,7 @@ {%- assign excludeFlag = true -%} {%- endif -%} - {%- if page.url contains 'search.html' or page.url contains 'search-test.html' -%} + {%- if page.url contains 'search.html' or page.url contains 'search-test.html' -%} {%- assign excludeFlag = true -%} {%- endif -%} @@ -40,13 +40,13 @@ {%- assign docFullPath = site.docFullPath -%} {%- assign docFullPathLastChar = docFullPath | split:'' | last -%} - {%- if docFullPathLastChar contains '/' -%} + {%- if docFullPathLastChar contains '/' -%} {%- assign truncateDocHomePageSize = docFullPath | size | minus:1 -%} {%- assign docFullPath = docFullPath | slice: 0, truncateDocHomePageSize -%} {%- endif -%} - {%- assign assetsPath = '/webres/wwwroot' -%} + {%- assign assetsPath = 'https://www.dynamsoft.com/webres/wwwroot' -%}s diff --git a/_includes/liquid_autoGenerateHistoryList.html b/_includes/liquid_autoGenerateHistoryList.html index 9dd8a5e..add3f0f 100644 --- a/_includes/liquid_autoGenerateHistoryList.html +++ b/_includes/liquid_autoGenerateHistoryList.html @@ -22,7 +22,7 @@ {%- endif -%} {%- if curPageVersion contains "latest version" -%} -
{{ curPageVersion }}
+{{ curPageVersion }}
{%- else -%}{{ "version " | append: curPageVersion }}
{%- endif -%} @@ -58,7 +58,7 @@ {%- endif -%} {%- endfor -%} {%- endif -%} - + {%- if curPageVersion == tmpPageVersion -%} {%- continue -%} {%- endif -%} @@ -78,7 +78,7 @@ {%- endif -%} {%- endfor -%} {%- endif -%} - + {%- if tmpUsedToMatchUrl != curUsedToMatchUrl -%} {%- continue -%} {%- endif -%} @@ -98,7 +98,7 @@ {%- assign firstLevelUrl = site.firstLevelUrl -%} {%- assign firstLevelUrlLastChar = firstLevelUrl | split:'' | last -%} - {%- if firstLevelUrlLastChar contains '/' -%} + {%- if firstLevelUrlLastChar contains '/' -%} {%- assign truncateDocHomePageSize = firstLevelUrl | size | minus:1 -%} {%- assign firstLevelUrl = firstLevelUrl | slice: 0, truncateDocHomePageSize -%} {%- endif -%} @@ -112,4 +112,3 @@ {%- assign historyRecode = historyRecode | append: '\nextUrlRecode\' | append: tmpPageVersion -%} {%- endfor -%} - diff --git a/_includes/liquid_generateFullTree.html b/_includes/liquid_generateFullTree.html index 8ff4677..b7d5308 100644 --- a/_includes/liquid_generateFullTree.html +++ b/_includes/liquid_generateFullTree.html @@ -56,4 +56,4 @@ {%- endif -%} {%- endif -%} -{%- endfor -%} \ No newline at end of file +{%- endfor -%} diff --git a/_includes/liquid_searchVersionTreeFile.html b/_includes/liquid_searchVersionTreeFile.html index ebb6321..3f52250 100644 --- a/_includes/liquid_searchVersionTreeFile.html +++ b/_includes/liquid_searchVersionTreeFile.html @@ -48,7 +48,7 @@ {%- else -%} {%- assign verDiff = tmpDiff | divided_by: 10 | divided_by: i -%} {%- endif -%} - {%- assign validVer = true -%} + {%- assign validVer = true -%} {%- break -%} {%- elsif curVal < targetVal -%} {%- assign needCheckSize = false -%} @@ -63,7 +63,7 @@ {%- assign verDiff = curVal | divided_by: 10 -%} {%- else -%} {%- assign verDiff = curVal | divided_by: 10 | divided_by: minSize -%} - {%- endif -%} + {%- endif -%} {%- endif -%} {% endunless %} {%- if validVer -%} @@ -91,4 +91,4 @@ {%- assign curDirPath = nearestFile | remove: needRemoveStr -%} {%- endif -%} {%- include {{ nearestFile }} ver=include.ver curPath=curDirPath lang=include.lang -%} -{%- endif -%} \ No newline at end of file +{%- endif -%} diff --git a/_includes/livehelp.html b/_includes/livehelp.html index ffae970..1abd511 100644 --- a/_includes/livehelp.html +++ b/_includes/livehelp.html @@ -8,4 +8,4 @@ \ No newline at end of file + diff --git a/_includes/main-page-head.html b/_includes/main-page-head.html index 0627c29..d70645f 100644 --- a/_includes/main-page-head.html +++ b/_includes/main-page-head.html @@ -53,4 +53,4 @@ {%- if page.latestPageUri -%} -{%- endif -%} \ No newline at end of file +{%- endif -%} diff --git a/_includes/page_header.html b/_includes/page_header.html index 35d644c..f65aba6 100644 --- a/_includes/page_header.html +++ b/_includes/page_header.html @@ -508,4 +508,4 @@ - \ No newline at end of file + diff --git a/_includes/productNav.html b/_includes/productNav.html index 3d46a6d..9f204e0 100644 --- a/_includes/productNav.html +++ b/_includes/productNav.html @@ -33,4 +33,4 @@ {%- endif -%} {%- if site.firstLevelUrl contains 'remote-scan/docs' -%} {%- include productNav/remoteScanNav.html -%} -{%- endif -%} \ No newline at end of file +{%- endif -%} diff --git a/_includes/productNav/companyNav.html b/_includes/productNav/companyNav.html index 885968a..ceb1ceb 100644 --- a/_includes/productNav/companyNav.html +++ b/_includes/productNav/companyNav.html @@ -12,4 +12,4 @@ - \ No newline at end of file + diff --git a/_includes/productNav/dbrNav.html b/_includes/productNav/dbrNav.html index 3e57e52..0a55029 100644 --- a/_includes/productNav/dbrNav.html +++ b/_includes/productNav/dbrNav.html @@ -60,4 +60,4 @@ - \ No newline at end of file + diff --git a/_includes/productNav/dceNav.html b/_includes/productNav/dceNav.html index a6b462e..8b59181 100644 --- a/_includes/productNav/dceNav.html +++ b/_includes/productNav/dceNav.html @@ -37,7 +37,6 @@