Skip to content

Commit

Permalink
Adding workflow items for Web App build (#3579)
Browse files Browse the repository at this point in the history
  • Loading branch information
blckmn authored Sep 15, 2023
1 parent 0a93ea4 commit 8572ecf
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 2 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/app-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Builds Betaflight Configurator for Web Deployment.

name: App Build (Web)

on:
workflow_call:
inputs:
path:
description: 'Specifies the path to use in the output of the build'
required: false
type: string

jobs:
test:
name: Test
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3

- name: Cache node_modules
uses: actions/cache@v3
with:
path: node_modules/
key: node_modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }}

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'

- run: yarn install --immutable --immutable-cache --check-cache

- name: Run unit tests
run: yarn test

build:
name: Build (Web App)
needs: test
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3

- name: Cache Vite
uses: actions/cache@v3
with:
path: cache/
key: vite-${{ inputs.path }}-${{ hashFiles('vite.config.js') }}

- name: Cache node_modules
uses: actions/cache@v3
with:
path: node_modules/
key: node_modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }}

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'

- run: yarn install --immutable --immutable-cache --check-cache

- run: yarn build

- name: Push to AWS
uses: jakejarvis/s3-sync-action@master
with:
args: --delete
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
SOURCE_DIR: 'dist'
DEST_DIR: ${{ inputs.path }}
12 changes: 12 additions & 0 deletions .github/workflows/app-nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: App Nightly Release

on:
schedule:
- cron: '0 0 * * *'

jobs:
ci:
name: App Build
uses: ./.github/workflows/app-build.yml
with:
path: 'nightly'
12 changes: 12 additions & 0 deletions .github/workflows/app-weekly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: App Weekly Release

on:
schedule:
- cron: '0 1 * * 0'

jobs:
ci:
name: App Build
uses: ./.github/workflows/app-build.yml
with:
path: 'weekly'
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Builds Betaflight Configurator on Windows, Android, Linux and macOS platforms.
#
# After building, artifacts are released to a seperate repository.
# After building, artifacts are released to a separate repository.

name: CI

on:
on:
workflow_call:
inputs:
debug_build:
Expand Down

0 comments on commit 8572ecf

Please sign in to comment.