From 1ac8761ef5d59baee28c87baaa2e2922900422e7 Mon Sep 17 00:00:00 2001 From: dynamsoft-h <172081603+dynamsoft-h@users.noreply.github.com> Date: Mon, 9 Jun 2025 16:06:41 -0700 Subject: [PATCH 1/3] fix: preview CI workflow --- .../called-workflow-build-sync-testing.yml | 17 ++++++++--------- .github/workflows/main.yml | 17 +++++++++++++---- 2 files changed, 21 insertions(+), 13 deletions(-) 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 From 162bb0cbef5691e846a31028bd037e5d57ea9c6e Mon Sep 17 00:00:00 2001 From: dynamsoft-h <172081603+dynamsoft-h@users.noreply.github.com> Date: Mon, 9 Jun 2025 16:37:15 -0700 Subject: [PATCH 2/3] fix: use absolute link to webres to remove it as a local build requirement --- _includes/head.html | 2 +- _includes/trialLicense.html | 4 ++-- _layouts/default-layout.html | 8 ++++---- _layouts/search-layout.html | 10 +++++----- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/_includes/head.html b/_includes/head.html index 54c9c31..94f8ac8 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -46,7 +46,7 @@ {%- endif -%} - {%- assign assetsPath = '/webres/wwwroot' -%} + {%- assign assetsPath = 'https://www.dynamsoft.com/webres/wwwroot' -%}s diff --git a/_includes/trialLicense.html b/_includes/trialLicense.html index 4042013..f4f641a 100644 --- a/_includes/trialLicense.html +++ b/_includes/trialLicense.html @@ -1,4 +1,4 @@ -{%- assign assetsPath = '/webres/wwwroot' -%} +{%- assign assetsPath = 'https://www.dynamsoft.com/webres/wwwroot' -%} @@ -335,4 +335,4 @@ - \ No newline at end of file + diff --git a/_layouts/default-layout.html b/_layouts/default-layout.html index 27ceec5..dcf1254 100644 --- a/_layouts/default-layout.html +++ b/_layouts/default-layout.html @@ -50,7 +50,7 @@ {{ content }} - {%- assign assetsPath = '/webres/wwwroot' -%} + {%- assign assetsPath = 'https://www.dynamsoft.com/webres/wwwroot' -%}