Skip to content

Commit 0441d91

Browse files
authored
Update main.yml
1 parent 6526318 commit 0441d91

1 file changed

Lines changed: 18 additions & 24 deletions

File tree

.github/workflows/main.yml

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -17,39 +17,33 @@ jobs:
1717
Build-v17-3:
1818
if: ${{ github.ref == 'refs/heads/v17.3' }}
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 v17.3 https://github.com/Dynamsoft/web-twain-docs.git web-twain-docs-archive
33-
git clone --depth 1 --branch dwt-v17.3 https://github.com/dynamsoft-docs/Docs-Template-Repo.git Docs-Template-Repo-archive
28+
git clone --depth 1 --branch v17.3 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-v17.3 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\/v17.3/" \
37-
-e "1,3s/blob\/main$/blob\/v17.3/" /home/ubuntu/DWTDocArchive/_config.yml
38-
cd DWTDocArchive && bundle exec jekyll build
39-
33+
-e "1,3s/blob\/main$/blob\/v17.3/" ${{ runner.temp }}/DWTDocArchive/_config.yml
34+
cd DWTDocArchive && bundle install && bundle exec jekyll build
35+
4036
- name: Sync files
4137
uses: SamKirkland/FTP-Deploy-Action@4.3.0
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/v17.3/
4945

50-
- name: Clear files
51-
run: |
52-
cd /home/ubuntu
53-
[ -d web-twain-docs-archive ] && rm -rf web-twain-docs-archive
54-
[ -d Docs-Template-Repo-archive ] && rm -rf Docs-Template-Repo-archive
55-
[ -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/v17.3/*\"]" ${{ secrets.WEBHOOK_URL }}

0 commit comments

Comments
 (0)