Hangar/.github/workflows/frontend_build.yml
2022-10-31 15:58:33 +01:00

63 lines
1.4 KiB
YAML

name: Build Frontend
on:
# allow manual dispatch
workflow_dispatch:
# run on PRs
pull_request:
paths:
- 'frontend/**'
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Set up pnpm
uses: pnpm/action-setup@v2
with:
version: 7
- name: Cache Pnpm
uses: actions/cache@v3
with:
path: "~/.pnpm-store"
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
- name: Install frontend deps
env:
CI: true
run: (cd frontend && pnpm install --frozen-lockfile && cd server && pnpm install --frozen-lockfile)
- name: Lint frontend
env:
CI: true
run: (cd frontend && pnpm lint:eslint)
- name: Build frontend
env:
CI: true
# keep these in sync with compose!
BACKEND_HOST: "http://hangar_backend:8080"
AUTH_HOST: "https://hangar-auth.benndorf.dev"
PUBLIC_HOST: "https://hangar.benndorf.dev"
DEBUG: "hangar:*"
run: (cd frontend && pnpm build && cd server && pnpm build)