Skip to content

Commit 4169f4c

Browse files
committed
dwt 19.0 build file update
1 parent 90119ff commit 4169f4c

File tree

2 files changed

+45
-91
lines changed

2 files changed

+45
-91
lines changed

.github/workflows/main.yml

Lines changed: 34 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,43 @@ on:
77
# Triggers the workflow on push events but only for the master branch
88
push:
99
branches:
10-
- master
11-
# - preview
10+
- v19.0
1211

1312
# Allows you to run this workflow manually from the Actions tab
1413
workflow_dispatch:
1514

1615
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
17-
jobs:
18-
# This workflow contains jobs called "Build-Main" and "Build-Preview"
19-
Build-Master:
20-
if: ${{ github.ref == 'refs/heads/master' }}
21-
uses: dynamsoft-docs/Docs-Template-Repo/.github/workflows/called-workflow-build-sync-production.yml@main
22-
with:
23-
doc-repo: web-twain-docs
24-
doc-url: web-twain/docs
25-
secrets: inherit
16+
jobs:
17+
Build-v18-4:
18+
if: ${{ github.ref == 'refs/heads/v19.0' }}
19+
# The type of runner that the job will run on
20+
runs-on: [self-hosted, doc-build]
2621

27-
Build-Preview:
28-
if: ${{ github.ref == 'refs/heads/preview' }}
29-
uses: dynamsoft-docs/Docs-Template-Repo/.github/workflows/called-workflow-build-sync-testing.yml@preview
30-
with:
31-
doc-repo: web-twain-docs
32-
doc-url: web-twain/docs
33-
secrets: inherit
34-
22+
# Steps represent a sequence of tasks that will be executed as part of the job
23+
steps:
24+
- name: Build the full site - main
25+
run: |
26+
cd ${{ runner.temp }}
27+
mkdir -p DWTDocArchive
28+
git clone --depth 1 --branch v19.0 https://${{ secrets.GIT_USER }}:${{ secrets.GIT_PAT }}@github.com/dynamsoft-docs/web-twain-docs.git web-twain-docs-archive
29+
git clone --depth 1 --branch dwt-v19.0 https://github.com/dynamsoft-docs/Docs-Template-Repo.git Docs-Template-Repo-Archive
30+
cp -rfp ./web-twain-docs-archive/* ./DWTDocArchive/
31+
cp -rfp ./Docs-Template-Repo-Archive/* ./DWTDocArchive/
32+
sed -i -e "1,3s/blob\/master$/blob\/v19.0/" \
33+
-e "1,3s/blob\/main$/blob\/v19.0/" ${{ runner.temp }}/DWTDocArchive/_config.yml
34+
cd DWTDocArchive && bundle install && bundle exec jekyll build
35+
36+
- name: Sync files
37+
uses: SamKirkland/FTP-Deploy-Action@4.3.0
38+
with:
39+
server: ${{ secrets.FTP_DYNAMSOFT_LOCAL_SERVER }}
40+
username: ${{ secrets.FTP_DYNAMSOFT_LOCAL_USER }}
41+
password: ${{ secrets.FTP_DYNAMSOFT_LOCAL_PASSWORD }}
42+
port: 21
43+
local-dir: ${{ runner.temp }}/DWTDocArchive/_site/
44+
server-dir: /www.dynamsoft.com/web-twain/docs-archive/v19.0/
45+
46+
47+
- name: Trigger Webhook
48+
run: |
49+
curl -X POST -H "${{ secrets.WEBHOOK_USER }}" -H "${{ secrets.WEBHOOK_TOKEN }}" -H "Content-Type: application/json" -d "[\"/web-twain/docs-archive/v19.0/*\"]" ${{ secrets.WEBHOOK_URL }}

.github/workflows/private-repo-build.yml

Lines changed: 11 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ on:
1010
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1111
jobs:
1212
# This workflow contains a single job called "build"
13-
Build-Master:
14-
if: ${{ github.ref == 'refs/heads/master' }}
13+
Build-v19-0:
14+
if: ${{ github.ref == 'refs/heads/19.0' }}
1515
# The type of runner that the job will run on
1616
runs-on: [self-hosted, doc-build]
1717

@@ -21,12 +21,12 @@ jobs:
2121
- name: Build the full site - main
2222
run: |
2323
cd ${{ runner.temp }}
24-
mkdir -p DocHome
25-
git clone --depth 1 https://${{ secrets.GIT_USER }}:${{ secrets.GIT_PAT }}@github.com/dynamsoft-docs/web-twain-docs.git web-twain-docs
26-
git clone --depth 1 https://github.com/dynamsoft-docs/Docs-Template-Repo.git Docs-Template-Repo
27-
cp -rfp ./web-twain-docs/* ./DocHome/
28-
cp -rfp ./Docs-Template-Repo/* ./DocHome/
29-
cd DocHome && bundle install && bundle exec jekyll build
24+
mkdir -p DWTDocArchive
25+
git clone --depth 1 --branch v19.0 https://${{ secrets.GIT_USER }}:${{ secrets.GIT_PAT }}@github.com/dynamsoft-docs/web-twain-docs.git web-twain-docs-archive
26+
git clone --depth 1 --branch dwt-v19.0 https://github.com/dynamsoft-docs/Docs-Template-Repo.git Docs-Template-Repo-archive
27+
cp -rfp ./web-twain-docs-archive/* ./DWTDocArchive/
28+
cp -rfp ./Docs-Template-Repo-archive/* ./DWTDocArchive/
29+
cd DWTDocArchive && bundle install && bundle exec jekyll build
3030
3131
- name: Sync files
3232
uses: SamKirkland/FTP-Deploy-Action@4.3.0
@@ -35,70 +35,9 @@ jobs:
3535
username: ${{ secrets.FTP_DYNAMSOFT_LOCAL_USER }}
3636
password: ${{ secrets.FTP_DYNAMSOFT_LOCAL_PASSWORD }}
3737
port: 21
38-
local-dir: ${{ runner.temp }}/DocHome/_site/
39-
server-dir: /www.dynamsoft.com/web-twain/docs/
38+
local-dir: ${{ runner.temp }}/DWTDocArchive/_site/
39+
server-dir: /www.dynamsoft.com/web-twain/docs-archive/v19.0/
4040

4141
- name: Trigger Webhook
4242
run: |
43-
curl -X POST -H "${{ secrets.WEBHOOK_USER }}" -H "${{ secrets.WEBHOOK_TOKEN }}" -H "Content-Type: application/json" -d "[\"/web-twain/docs/*\"]" ${{ secrets.WEBHOOK_URL }}
44-
45-
46-
Build-Site-Preview:
47-
if: ${{ github.ref == 'refs/heads/preview' }}
48-
# The type of runner that the job will run on
49-
runs-on: [self-hosted, doc-build]
50-
51-
# Steps represent a sequence of tasks that will be executed as part of the job
52-
steps:
53-
# Runs a set of commands using the runners shell
54-
- name: Build the full site with preview branch
55-
run: |
56-
cd ${{ runner.temp }}
57-
mkdir -p DocHome
58-
git clone --depth 1 --branch preview https://${{ secrets.GIT_USER }}:${{ secrets.GIT_PAT }}@github.com/dynamsoft-docs/web-twain-docs.git web-twain-docs
59-
git clone --depth 1 --branch preview https://github.com/dynamsoft-docs/Docs-Template-Repo.git Docs-Template-Repo
60-
cp -rfp ./web-twain-docs/* ./DocHome/
61-
cp -rfp ./Docs-Template-Repo/* ./DocHome/
62-
sed -i -e "1,3s/blob\/master$/blob\/preview/" \
63-
-e "1,3s/blob\/main$/blob\/preview/" ${{ runner.temp }}/DocHome/_config.yml
64-
cd DocHome && bundle install && bundle exec jekyll build
65-
66-
- name: 'Create Tar files'
67-
run: tar -czvf web-twain-docs.tar.gz -C ${{ runner.temp }}/DocHome/_site .
68-
69-
- name: Upload the built site as a single artifact
70-
uses: actions/upload-artifact@v3
71-
with:
72-
name: web-twain-docs
73-
path: web-twain-docs.tar.gz
74-
retention-days: 2
75-
76-
Sync-To-Testing:
77-
# The type of runner that the job will run on
78-
runs-on: [self-hosted, upload-test]
79-
needs: Build-Site-Preview
80-
81-
# Steps represent a sequence of tasks that will be executed as part of the job
82-
steps:
83-
# Runs a set of commands using the runners shell
84-
- name: Download the artifact
85-
uses: actions/download-artifact@v3
86-
with:
87-
name: web-twain-docs
88-
89-
- name: 'Extract Tar files'
90-
shell: cmd
91-
run: |
92-
mkdir ${{ runner.temp }}\DocHome\_site
93-
tar -xzf web-twain-docs.tar.gz -C ${{ runner.temp }}\DocHome\_site
94-
95-
- name: Sync files
96-
uses: SamKirkland/FTP-Deploy-Action@4.3.0
97-
with:
98-
server: ${{ secrets.FTP_TEST_SITE_SERVER }}
99-
username: ${{ secrets.FTP_TEST_SITE_USER }}
100-
password: ${{ secrets.FTP_TEST_SITE_PASSWORD }}
101-
port: 7500
102-
local-dir: ${{ runner.temp }}\DocHome\_site/
103-
server-dir: /www.dynamsoft.com/web-twain/docs/
104-
43+
curl -X POST -H "${{ secrets.WEBHOOK_USER }}" -H "${{ secrets.WEBHOOK_TOKEN }}" -H "Content-Type: application/json" -d "[\"/web-twain/docs/*\"]" ${{ secrets.WEBHOOK_URL }}

0 commit comments

Comments
 (0)