Skip to content

Merge pull request #1741 from threefoldtech/development_caprover_version #65

Merge pull request #1741 from threefoldtech/development_caprover_version

Merge pull request #1741 from threefoldtech/development_caprover_version #65

Workflow file for this run

# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and deploy to staging server by Copying the artifacts using ssh to play.dev.grid.tf
name: Weblets CD
on:
push:
branches:
- development
paths:
- "packages/weblets/**"
workflow_dispatch:
concurrency:
# one instance of runing pipeline allowed per branch.
# On master, we want all builds to complete even if merging happens faster for better reliability and to make it easier to discover at which point something broke.
# on developmetn, new workflow trigger will cancel the in progress job, and start a new one..
group: ${{ format('ci-{0}', github.ref) }}
cancel-in-progress: ${{ github.event_name == 'release' && github.event.release.prerelease == false }}
jobs:
build-and-deploy:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ["18.16.0"]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v2
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: "yarn"
cache-dependency-path: "**/yarn.lock"
- name: Install dependencies
run: |
yarn install
cd packages/weblets/playground
yarn install
- name: Build in case development
env:
NODE_OPTIONS: "--max-old-space-size=8192 --openssl-legacy-provider"
run: |
lerna run build --no-private
cd packages/weblets
VERSION=$GITHUB_SHA
VERSION=${VERSION:0:7} NETWORK=dev yarn build:app
- name: Copying files to staging server
uses: appleboy/scp-action@master
with:
host: ${{ secrets.DEV_REMOTE_HOST }}
username: ${{ secrets.DEV_REMOTE_USER }}
key: ${{ secrets.DEV_SSH_KEY }}
passphrase: ${{ secrets.DEV_SSH_KEY_PASSPHRASE }}
rm: true
port: ${{ secrets.PORT }}
source: "packages/weblets/dist/"
target: "${{ secrets.DEV_REMOTE_DIR }}"
strip_components: 3