Update video-utils.js #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: 'build binaries' | |
on: push | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
- name: Prepare | |
id: prepare | |
run: | | |
SHORTREF=${GITHUB_SHA::8} | |
BRANCH=${GITHUB_REF#refs/heads/} | |
VERSION=${BRANCH//\//-} | |
SNAPSHOT="-$(date +%Y%m%d)-${SHORTREF}" | |
TARGET_DIR=unstable/ | |
# If this is git tag, use the tag name as a docker tag | |
if [[ $GITHUB_REF == refs/tags/* ]]; then | |
TAG_VERSION=${GITHUB_REF#refs/tags/v} | |
# If we have a major.minor.patch version install | |
# binary below the root | |
if [[ $TAG_VERSION =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then | |
VERSION=$TAG_VERSION | |
SNAPSHOT= | |
TARGET_DIR=/ | |
fi | |
fi | |
# Set output parameters. | |
echo VERSION=${VERSION} >> $GITHUB_OUTPUT | |
echo SNAPSHOT=${SNAPSHOT} >> $GITHUB_OUTPUT | |
echo TARGET_DIR=${TARGET_DIR} >> $GITHUB_OUTPUT | |
- name: Install packages | |
id: install | |
run: | | |
rm -rf packages/api-server packages/styleguide | |
node scripts/disable-dependency.js api-server styleguide | |
npm install --force | |
- name: Build packages | |
id: build | |
run: | | |
npx pnpm --filter '*bundle' build | |
node scripts/bundle.js "--version=${{ steps.prepare.outputs.VERSION }}" "--snapshot=${{ steps.prepare.outputs.SNAPSHOT }}" | |
- name: Deploy via rsync | |
id: deploy | |
uses: up9cloud/action-rsync@master | |
env: | |
HOST: ${{secrets.SSH_HOSTNAME}} | |
USER: ${{secrets.SSH_USERNAME}} | |
KEY: ${{secrets.SSH_PRIVATE_KEY}} | |
SOURCE: ./dist/ | |
TARGET: ${{ steps.prepare.outputs.TARGET_DIR }} | |
ARGS: -avz | |
SSH_ARGS: '-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' | |
VERBOSE: true |