Skip to content

Merge pull request #136 from dynamsoft-docs/preview #397

Merge pull request #136 from dynamsoft-docs/preview

Merge pull request #136 from dynamsoft-docs/preview #397

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push events but only for the master branch
push:
branches:
- main
#- preview
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains jobs called "Build-Main" and "Build-Preview"
Build-Main:
if: ${{ github.ref == 'refs/heads/main' }}
uses: dynamsoft-docs/Docs-Template-Repo/.github/workflows/called-workflow-build-sync-production.yml@main
with:
doc-repo: barcode-reader-docs-server
doc-url: barcode-reader/docs/server
secrets: inherit
Build-Preview:
if: ${{ github.ref == 'refs/heads/preview' }}
uses: dynamsoft-docs/Docs-Template-Repo/.github/workflows/called-workflow-build-sync-testing.yml@preview
with:
doc-repo: barcode-reader-docs-server
doc-url: barcode-reader/docs/server
secrets: inherit
# Build-Preview:
# if: ${{ github.ref == 'refs/heads/preview' }}
# # The type of runner that the job will run on
# runs-on: [self-hosted, r3]
#
# # Steps represent a sequence of tasks that will be executed as part of the job
# steps:
# # Runs a set of commands using the runners shell
# - name: Build the site - Preview
# run: |
# cd /home/ubuntu
# [ ! -d DBRDocServer-preview ] && mkdir -p DBRDocServer-preview
# [ ! -d barcode-reader-docs-server-preview ] && git clone --depth 1 --branch preview https://github.com/dynamsoft-docs/barcode-reader-docs-server.git barcode-reader-docs-server-preview
# [ ! -d Docs-Template-Repo-Preview-R3 ] && git clone --depth 1 --branch preview https://github.com/dynamsoft-docs/Docs-Template-Repo.git Docs-Template-Repo-Preview-R3
# cd barcode-reader-docs-server-preview && git pull && cd .. && cp -rfp ./barcode-reader-docs-server-preview/* ./DBRDocServer-preview/
# cd Docs-Template-Repo-Preview-R3 && git pull && cd .. && cp -rfp ./Docs-Template-Repo-Preview-R3/* ./DBRDocServer-preview/
# sed -i -e "1,3s/blob\/master$/blob\/preview/" \
# -e "1,3s/blob\/main$/blob\/preview/" /home/ubuntu/DBRDocServer-preview/_config.yml
# cd DBRDocServer-preview && bundle exec jekyll build --incremental
#
# Upload-Preview:
# if: ${{ github.ref == 'refs/heads/preview' }}
# # The type of runner that the job will run on
# runs-on: [self-hosted, r3]
# needs: Build-Preview
#
# # Steps represent a sequence of tasks that will be executed as part of the job
# steps:
# # Runs a set of commands using the runners shell
# - name: Sync files
# uses: SamKirkland/[email protected]
# with:
# server: ${{ secrets.FTP_TEST_SITE_SERVER }}
# username: ${{ secrets.FTP_TEST_SITE_USER }}
# password: ${{ secrets.FTP_TEST_SITE_PASSWORD }}
# port: 7500
# local-dir: /home/ubuntu/DBRDocServer-preview/_site/
# server-dir: /www.dynamsoft.com/barcode-reader/docs/server/