Skip to content

Commit

Permalink
[add] parallel building releases
Browse files Browse the repository at this point in the history
  • Loading branch information
VecHK committed Dec 16, 2023
1 parent ecae245 commit 14e2287
Showing 1 changed file with 92 additions and 55 deletions.
147 changes: 92 additions & 55 deletions .github/workflows/release-dev.yml
Original file line number Diff line number Diff line change
@@ -9,62 +9,99 @@ on:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build-front-dev:
name: Build development version
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: dashboard-build
path: dashboard

build-front:
name: Build Front
runs-on: ubuntu-latest
if: contains(github.event.commits.*.message, '[skip ci]') == false

steps:
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '16'

- name: Copy Repo Files
uses: actions/checkout@v2

- 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
mv build ../
- 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
mv dashboard ../build/
- 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: |
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
- 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
- uses: actions/upload-artifact@v4
with:
name: front-build
path: build

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: front-build
path: releases

- uses: actions/download-artifact@v4
with:
name: dashboard-build
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

0 comments on commit 14e2287

Please sign in to comment.