Hangar/.github/workflows/frontend_build.yml

63 lines
1.4 KiB
YAML
Raw Normal View History

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
2022-06-29 03:12:44 +08:00
with:
submodules: true
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: '16'
2022-03-21 20:41:17 +08:00
- name: Set up pnpm
uses: pnpm/action-setup@v2
2022-03-21 20:41:17 +08:00
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@v3
2022-03-21 20:41:17 +08:00
with:
path: "~/.pnpm-store"
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
- name: Install frontend deps
2022-03-21 20:41:17 +08:00
env:
CI: true
run: (cd frontend && pnpm install --frozen-lockfile && cd server && pnpm install --frozen-lockfile)
- name: Lint frontend
2022-03-21 20:41:17 +08:00
env:
CI: true
run: (cd frontend && pnpm lint:eslint)
- 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"
PUBLIC_HOST: "https://hangar.benndorf.dev"
2022-07-29 17:42:38 +08:00
DEBUG: "hangar:*"
run: (cd frontend && pnpm build && cd server && pnpm build)
2022-03-21 20:41:17 +08:00