|
16 | 16 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel |
17 | 17 | jobs: |
18 | 18 | # This workflow contains jobs called "Build-Master" and "Build-Preview" |
19 | | - Build-Master: |
| 19 | + Build-Main: |
20 | 20 | if: ${{ github.ref == 'refs/heads/master' }} |
21 | | - # The type of runner that the job will run on |
22 | | - runs-on: self-hosted |
23 | | - |
24 | | - # Steps represent a sequence of tasks that will be executed as part of the job |
25 | | - steps: |
26 | | - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it |
27 | | - #- uses: actions/checkout@v2 |
28 | | - |
29 | | - # Runs a set of commands using the runners shell |
30 | | - - name: Run a multi-line script |
31 | | - run: | |
32 | | - cd /home/ubuntu |
33 | | - [ -d DLRDocCore ] && rm -rf DLRDocCore |
34 | | - [ -d label-recognition-docs ] && rm -rf label-recognition-docs |
35 | | - [ -d Docs-Template-Repo-Preview ] && rm -rf Docs-Template-Repo-Preview |
36 | | - [ ! -d DLRDocCore ] && mkdir -p DLRDocCore |
37 | | - git clone --depth 1 https://github.com/dynamsoft-docs/label-recognition-docs.git label-recognition-docs |
38 | | - git clone --depth 1 --branch preview https://github.com/dynamsoft-docs/Docs-Template-Repo.git Docs-Template-Repo-Preview |
39 | | - cp -rfp ./label-recognition-docs/* ./DLRDocCore/ |
40 | | - cp -rfp ./Docs-Template-Repo-Preview/* ./DLRDocCore/ |
41 | | - cd DLRDocCore && bundle exec jekyll build --incremental |
42 | | -
|
43 | | - - name: Sync files - Main Site |
44 | | - uses: SamKirkland/[email protected] |
45 | | - with: |
46 | | - server: ${{ secrets.FTP_DYNAMSOFT_LOCAL_SERVER }} |
47 | | - username: ${{ secrets.FTP_DYNAMSOFT_LOCAL_USER }} |
48 | | - password: ${{ secrets.FTP_DYNAMSOFT_LOCAL_PASSWORD }} |
49 | | - port: 21 |
50 | | - local-dir: /home/ubuntu/DLRDocCore/_site/ |
51 | | - server-dir: /www.dynamsoft.com/label-recognition/docs/core/ |
52 | | - |
53 | | - - name: Trigger Webhook |
54 | | - run: | |
55 | | - curl -X POST -H "${{ secrets.WEBHOOK_USER }}" -H "${{ secrets.WEBHOOK_TOKEN }}" -H "Content-Type: application/json" -d "[\"/label-recognition/docs/core/*\"]" ${{ secrets.WEBHOOK_URL }} |
56 | | -
|
| 21 | + uses: dynamsoft-docs/Docs-Template-Repo/.github/workflows/called-workflow-build-sync-production.yml@main |
| 22 | + with: |
| 23 | + doc-repo: label-recognition-docs |
| 24 | + doc-url: label-recognition/docs/core |
| 25 | + secrets: inherit |
57 | 26 |
|
58 | 27 | Build-Preview: |
59 | 28 | if: ${{ github.ref == 'refs/heads/preview' }} |
60 | | - # The type of runner that the job will run on |
61 | | - runs-on: self-hosted |
62 | | - |
63 | | - # Steps represent a sequence of tasks that will be executed as part of the job |
64 | | - steps: |
65 | | - # Runs a set of commands using the runners shell |
66 | | - - name: clear space |
67 | | - run: | |
68 | | - cd /home/ubuntu |
69 | | - [ -d DLRDocCorePreview ] && rm -rf DLRDocCorePreview |
70 | | - [ -d label-recognition-docs-core-preview ] && rm -rf label-recognition-docs-core-preview |
71 | | - [ -d Docs-Template-Repo-Preview ] && rm -rf Docs-Template-Repo-Preview |
72 | | - cd /home/ubuntu |
73 | | -
|
74 | | - - name: Build the site |
75 | | - run: | |
76 | | - cd /home/ubuntu |
77 | | - [ ! -d DLRDocCorePreview ] && mkdir -p DLRDocCorePreview |
78 | | - git clone --depth 1 --branch preview https://github.com/Dynamsoft-Docs/label-recognition-docs.git label-recognition-docs-core-preview |
79 | | - git clone --depth 1 --branch preview https://github.com/dynamsoft-docs/Docs-Template-Repo.git Docs-Template-Repo-Preview |
80 | | - cp -rfp ./label-recognition-docs-core-preview/* ./DLRDocCorePreview/ |
81 | | - cp -rfp ./Docs-Template-Repo-Preview/* ./DLRDocCorePreview/ |
82 | | - sed -i -e "1,3s/blob\/master$/blob\/preview/" \ |
83 | | - -e "1,3s/blob\/main$/blob\/preview/" /home/ubuntu/DLRDocCorePreview/_config.yml |
84 | | - cd DLRDocCorePreview && bundle exec jekyll build |
85 | | -
|
86 | | - - name: Sync files |
87 | | - uses: SamKirkland/[email protected] |
88 | | - with: |
89 | | - server: ${{ secrets.FTP_TEST_SITE_SERVER }} |
90 | | - username: ${{ secrets.FTP_TEST_SITE_USER }} |
91 | | - password: ${{ secrets.FTP_TEST_SITE_PASSWORD }} |
92 | | - port: 7500 |
93 | | - local-dir: /home/ubuntu/DLRDocCorePreview/_site/ |
94 | | - server-dir: /www.dynamsoft.com/label-recognition/docs/core/ |
| 29 | + uses: dynamsoft-docs/Docs-Template-Repo/.github/workflows/called-workflow-build-sync-testing.yml@preview |
| 30 | + with: |
| 31 | + doc-repo: label-recognition-docs |
| 32 | + doc-url: label-recognition/docs/core |
| 33 | + secrets: inherit |
0 commit comments