fix: bugs #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Modrinth Frontend build' | |
on: | |
push: | |
branches: | |
- zhcn | |
paths: | |
- .github/workflows/frontend-build.yml | |
- 'apps/app/**' | |
- 'apps/frontend/**' | |
- 'packages/assets/**' | |
- 'packages/ui/**' | |
- 'packages/utils/**' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Install pnpm via corepack | |
shell: bash | |
run: | | |
corepack enable | |
corepack prepare --activate | |
- name: Get pnpm store directory | |
id: pnpm-cache | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
- name: Setup pnpm cache | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: Install frontend dependencies | |
run: pnpm install | |
- name: Build frontend | |
run: pnpm web:build | |
- name: Upload output | |
uses: actions/upload-artifact@v4 | |
with: | |
name: output | |
path: apps/frontend/.output |