mirror of
https://github.com/HangarMC/Hangar.git
synced 2024-12-15 06:41:46 +08:00
89 lines
2.2 KiB
YAML
89 lines
2.2 KiB
YAML
name: Build Frontend
|
|
|
|
on:
|
|
# allow manual dispatch
|
|
workflow_dispatch:
|
|
# run on PRs
|
|
pull_request:
|
|
paths:
|
|
- 'frontend/**'
|
|
- 'frontend-new/**'
|
|
|
|
concurrency:
|
|
group: ${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Set up Node
|
|
uses: actions/setup-node@v2
|
|
with:
|
|
node-version: '16'
|
|
|
|
- name: Set up pnpm
|
|
uses: pnpm/action-setup@v2.1.0
|
|
with:
|
|
version: 6
|
|
|
|
- name: Cache Pnpm
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: "~/.pnpm-store"
|
|
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-pnpm-
|
|
|
|
- name: Cache Yarn
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: "~/.cache/yarn"
|
|
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-yarn-
|
|
|
|
- name: Install frontend deps
|
|
env:
|
|
CI: true
|
|
run: (cd frontend-new && pnpm install --frozen-lockfile && cd server && pnpm install --frozen-lockfile)
|
|
|
|
- name: Install frontend deps old
|
|
env:
|
|
CI: true
|
|
run: (cd frontend && yarn install --frozen-lockfile --cache-folder ~/.cache/yarn)
|
|
|
|
- name: Lint frontend
|
|
env:
|
|
CI: true
|
|
run: (cd frontend-new && pnpm lint:eslint)
|
|
|
|
- name: Lint frontend old
|
|
env:
|
|
CI: true
|
|
run: (cd frontend && yarn lint)
|
|
|
|
- name: Build frontend
|
|
env:
|
|
CI: true
|
|
# keep these in sync with compose!
|
|
proxyHost: "http://hangar_new_backend:8080"
|
|
authHost: "https://hangar-auth.benndorf.dev"
|
|
host: "0.0.0.0"
|
|
PUBLIC_HOST: "https://hangar.benndorf.dev"
|
|
run: (cd frontend-new && pnpm build && cd server && pnpm build)
|
|
|
|
- name: Build frontend old
|
|
env:
|
|
CI: true
|
|
# keep these in sync with compose!
|
|
proxyHost: "http://hangar_new_backend:8080"
|
|
authHost: "https://hangar-auth.benndorf.dev"
|
|
host: "0.0.0.0"
|
|
PUBLIC_HOST: "https://hangar-old.benndorf.dev"
|
|
run: (cd frontend && yarn build)
|