Skip to content

CI

CI #5

Workflow file for this run

name: CI
on:
workflow_dispatch:
jobs:
Build-Demo:
if: ${{ github.ref == 'refs/heads/demo' }}
runs-on: self-hosted
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
steps:
- name: Get Source
run: |
cd /home/ubuntu
[ -d dynamsoft-mobile-web-capture ] && rm -rf dynamsoft-mobile-web-capture
git clone --depth 1 -b demo https://github.com/Dynamsoft/mobile-web-capture.git dynamsoft-mobile-web-capture
- name: Prepare Files
run: |
# Create deploy directory
mkdir -p /home/ubuntu/dynamsoft-mobile-web-capture/deploy
mkdir -p /home/ubuntu/dynamsoft-mobile-web-capture/deploy/scenarios
# Copy dist folder
cp -r /home/ubuntu/dynamsoft-mobile-web-capture/dist /home/ubuntu/dynamsoft-mobile-web-capture/deploy/
# Copy index.html and assets from demo
cp /home/ubuntu/dynamsoft-mobile-web-capture/samples/demo/index.html /home/ubuntu/dynamsoft-mobile-web-capture/deploy/
cp -r /home/ubuntu/dynamsoft-mobile-web-capture/samples/demo/assets /home/ubuntu/dynamsoft-mobile-web-capture/deploy/
# Copy scenario files
cp /home/ubuntu/dynamsoft-mobile-web-capture/samples/scenarios/customized-empty-container.html /home/ubuntu/dynamsoft-mobile-web-capture/deploy/scenarios/
cp /home/ubuntu/dynamsoft-mobile-web-capture/samples/scenarios/use-file-input.html /home/ubuntu/dynamsoft-mobile-web-capture/deploy/scenarios/
# Copy hello-world.html
cp /home/ubuntu/dynamsoft-mobile-web-capture/samples/hello-world.html /home/ubuntu/dynamsoft-mobile-web-capture/deploy/
- name: Sync files
uses: SamKirkland/[email protected]
with:
server: ${{ secrets.FTP_DEMO_SERVER }}
username: ${{ secrets.FTP_DEMO_USERNAME }}
password: ${{ secrets.FTP_DEMO_PASSWORD }}
port: 21
local-dir: /home/ubuntu/dynamsoft-mobile-web-capture/deploy/
server-dir: /Demo.dynamsoft.com/mobile-web-capture/