Skip to content

[add] parallel building releases #17

[add] parallel building releases

[add] parallel building releases #17

Workflow file for this run

name: Release DEV
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches:
- dev
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build-dashboard:
name: Build Dashboard
runs-on: ubuntu-latest
if: contains(github.event.commits.*.message, '[skip ci]') == false
steps:
- name: Copy Repo Files
uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '12.14.0'
- name: Build Dashboard
env:
NODE_ENV: development
run: |
cd dashboard
echo "${{secrets.DASHBOARD_ENV_DEVELOPMENT}}\n" > ./.env.production
npm install
npm run build:prod
mv dist dashboard
- uses: actions/upload-artifact@v4
with:
name: DashboardBuild
path: dashboard
- name: Display Dir
run: ls ./
build-front:
name: Build Front
runs-on: ubuntu-latest
if: contains(github.event.commits.*.message, '[skip ci]') == false
steps:
- name: Copy Repo Files
uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '16'
- name: Build Front
env:
NODE_ENV: development
run: |
cd front
echo "${{secrets.FRONT_ENV_DEVELOPMENT}}" > ./.env.development
echo "REACT_APP_BUILD_DESCRIPTION=Development version. build:${{ github.run_number }} commit:${{ github.sha }}" >> ./.env.production
yarn install --production=false
yarn build:development
ls ./
- uses: actions/upload-artifact@v4
with:
name: FrontBuild
path: build
- name: Display Dir
run: ls ./
upload-build:
name: upload Builds
needs: [build-front, build-dashboard]
runs-on: ubuntu-latest
if: contains(github.event.commits.*.message, '[skip ci]') == false
steps:
- uses: actions/download-artifact@v4
with:
name: DashboardBuild
path: releases
- uses: actions/download-artifact@v4
with:
name: FrontBuild
path: releases
- name: Display structure of downloaded files
run: ls -R releases
- name: Install SSH Key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
known_hosts: 'a'
- name: Upload Builds
env:
SSH_USERNAME: ${{ secrets.SSH_USERNAME }}
SSH_HOST: ${{ secrets.SSH_HOST }}
REMOTE_UPLOAD_PATH: ${{ secrets.DEV_REMOTE_UPLOAD_PATH }}
run: |
cd releases
mv dashboard build/
ssh-keyscan -H ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts
../scripts/upload.sh
- name: get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@master