forked from betaflight/betaflight-configurator
-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (70 loc) · 2.09 KB
/
app-build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# 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
secrets:
AWS_S3_BUCKET:
required: true
AWS_ACCESS_KEY_ID:
required: true
AWS_SECRET_ACCESS_KEY:
required: true
AWS_REGION:
required: true
jobs:
test:
name: Test
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Cache node_modules
uses: actions/cache@v4
with:
path: node_modules/
key: node_modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
- name: Install Node.js
uses: actions/setup-node@v4
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@v4
- name: Cache Vite
uses: actions/cache@v4
with:
path: cache/
key: vite-${{ inputs.path }}-${{ hashFiles('vite.config.js') }}
- name: Cache node_modules
uses: actions/cache@v4
with:
path: node_modules/
key: node_modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- run: yarn install --immutable --immutable-cache --check-cache
- run: yarn build
- name: Push to AWS
if: github.repository_owner == 'betaflight'
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: 'src/dist'
DEST_DIR: ${{ inputs.path }}