2021-06-01 14:11:08 +08:00
|
|
|
name: Build Frontend
|
|
|
|
|
|
|
|
on:
|
|
|
|
# allow manual dispatch
|
|
|
|
workflow_dispatch:
|
|
|
|
# run on PRs
|
|
|
|
pull_request:
|
|
|
|
paths:
|
|
|
|
- 'frontend/**'
|
|
|
|
|
|
|
|
concurrency:
|
2021-12-04 01:25:37 +08:00
|
|
|
group: ${{ github.ref }}
|
2021-06-01 14:11:08 +08:00
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
2022-06-29 03:12:44 +08:00
|
|
|
with:
|
|
|
|
submodules: true
|
2021-06-01 14:11:08 +08:00
|
|
|
|
|
|
|
- name: Set up Node
|
|
|
|
uses: actions/setup-node@v2
|
|
|
|
with:
|
2021-12-23 20:34:01 +08:00
|
|
|
node-version: '16'
|
2021-06-01 14:11:08 +08:00
|
|
|
|
2022-03-21 20:41:17 +08:00
|
|
|
- name: Set up pnpm
|
|
|
|
uses: pnpm/action-setup@v2.1.0
|
|
|
|
with:
|
2022-07-09 18:11:52 +08:00
|
|
|
version: 7
|
2022-03-21 20:41:17 +08:00
|
|
|
|
|
|
|
- name: Cache Pnpm
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: "~/.pnpm-store"
|
|
|
|
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-pnpm-
|
|
|
|
|
2021-06-01 14:11:08 +08:00
|
|
|
- name: Install frontend deps
|
2022-03-21 20:41:17 +08:00
|
|
|
env:
|
|
|
|
CI: true
|
2022-06-19 07:00:21 +08:00
|
|
|
run: (cd frontend && pnpm install --frozen-lockfile && cd server && pnpm install --frozen-lockfile)
|
2021-06-01 14:11:08 +08:00
|
|
|
|
|
|
|
- name: Lint frontend
|
2022-03-21 20:41:17 +08:00
|
|
|
env:
|
|
|
|
CI: true
|
2022-06-19 07:00:21 +08:00
|
|
|
run: (cd frontend && pnpm lint:eslint)
|
2021-06-01 14:11:08 +08:00
|
|
|
|
|
|
|
- name: Build frontend
|
|
|
|
env:
|
|
|
|
CI: true
|
|
|
|
# keep these in sync with compose!
|
2022-07-29 03:10:20 +08:00
|
|
|
BACKEND_HOST: "http://hangar_backend:8080"
|
|
|
|
AUTH_HOST: "https://hangar-auth.benndorf.dev"
|
2021-06-01 14:11:08 +08:00
|
|
|
PUBLIC_HOST: "https://hangar.benndorf.dev"
|
2022-07-29 17:42:38 +08:00
|
|
|
DEBUG: "hangar:*"
|
2022-06-19 07:00:21 +08:00
|
|
|
run: (cd frontend && pnpm build && cd server && pnpm build)
|
2022-03-21 20:41:17 +08:00
|
|
|
|