Skip to content

Commit 9ade2ad

Browse files
authored
Update main.yml
1 parent b61891b commit 9ade2ad

File tree

1 file changed

+18
-33
lines changed

1 file changed

+18
-33
lines changed

.github/workflows/main.yml

Lines changed: 18 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -17,48 +17,33 @@ jobs:
1717
Build-v18-1:
1818
if: ${{ github.ref == 'refs/heads/v18.1' }}
1919
# The type of runner that the job will run on
20-
runs-on: self-hosted
20+
runs-on: [self-hosted, doc-build]
2121

2222
# Steps represent a sequence of tasks that will be executed as part of the job
2323
steps:
24-
# Runs a set of commands using the runners shell
25-
- name: Build the site
24+
- name: Build the full site - main
2625
run: |
27-
cd /home/ubuntu
28-
[ -d web-twain-docs-archive ] && rm -rf web-twain-docs-archive
29-
[ -d Docs-Template-Repo-archive ] && rm -rf Docs-Template-Repo-archive
30-
[ -d DWTDocArchive ] && rm -rf DWTDocArchive
26+
cd ${{ runner.temp }}
3127
mkdir -p DWTDocArchive
32-
git clone --depth 1 --branch v18.1 https://github.com/Dynamsoft/web-twain-docs.git web-twain-docs-archive
33-
git clone --depth 1 --branch dwt-v18.1 https://github.com/dynamsoft-docs/Docs-Template-Repo.git Docs-Template-Repo-archive
28+
git clone --depth 1 --branch v18.1 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-v18.1 https://github.com/dynamsoft-docs/Docs-Template-Repo.git Docs-Template-Repo-Archive
3430
cp -rfp ./web-twain-docs-archive/* ./DWTDocArchive/
35-
cp -rfp ./Docs-Template-Repo-archive/* ./DWTDocArchive/
31+
cp -rfp ./Docs-Template-Repo-Archive/* ./DWTDocArchive/
3632
sed -i -e "1,3s/blob\/master$/blob\/v18.1/" \
37-
-e "1,3s/blob\/main$/blob\/v18.1/" /home/ubuntu/DWTDocArchive/_config.yml
38-
cd DWTDocArchive && bundle exec jekyll build
39-
33+
-e "1,3s/blob\/main$/blob\/v18.1/" ${{ runner.temp }}/DWTDocArchive/_config.yml
34+
cd DWTDocArchive && bundle install && bundle exec jekyll build
35+
4036
- name: Sync files
4137
uses: SamKirkland/[email protected]
4238
with:
43-
server: ${{ secrets.FTP_TEST_SITE_SERVER }}
44-
username: ${{ secrets.FTP_TEST_SITE_USER }}
45-
password: ${{ secrets.FTP_TEST_SITE_PASSWORD }}
46-
port: 7500
47-
local-dir: /home/ubuntu/DWTDocArchive/_site/
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/
4844
server-dir: /www.dynamsoft.com/web-twain/docs-archive/v18.1/
49-
# - name: Sync files to Test Env
50-
# uses: SamKirkland/[email protected]
51-
# with:
52-
# server: ${{ secrets.FTP_TEST_SITE_SERVER }}
53-
# username: ${{ secrets.FTP_TEST_SITE_USER }}
54-
# password: ${{ secrets.FTP_TEST_SITE_PASSWORD }}
55-
# port: 7500
56-
# local-dir: /home/ubuntu/DWTDocArchive/_site/
57-
# server-dir: /www.dynamsoft.com/web-twain/docs-archive/v18.1/
5845

59-
- name: Clear files
60-
run: |
61-
cd /home/ubuntu
62-
[ -d web-twain-docs-archive ] && rm -rf web-twain-docs-archive
63-
[ -d Docs-Template-Repo-archive ] && rm -rf Docs-Template-Repo-archive
64-
[ -d DWTDocArchive ] && rm -rf DWTDocArchive
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/v18.1/*\"]" ${{ secrets.WEBHOOK_URL }}

0 commit comments

Comments
 (0)