feat: pnpm-monorepo (#236)

This commit is contained in:
Jason Rasmussen
2025-10-14 17:04:39 -04:00
committed by GitHub
parent 9c0db648d8
commit e32cd9b218
234 changed files with 6784 additions and 9941 deletions
+42 -28
View File
@@ -22,41 +22,43 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
app_name: ['api', 'root', 'my', 'buy', 'get', 'datasets']
app_name: ['root', 'api', 'my', 'get', 'buy', 'datasets']
defaults:
run:
working-directory: apps/${{ matrix.app_name }}.immich.app
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- name: Setup pnpm
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
- name: Setup Node
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
node-version-file: '.nvmrc'
node-version-file: './.nvmrc'
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- name: Set app
run: |
touch .env
echo IMMICH_APP="${{ matrix.app_name }}.immich.app" >> .env
- name: Install
run: pnpm install
- name: Use futopay-test
if: ${{ env.ENVIRONMENT == 'dev' }}
run: |
echo PUBLIC_IMMICH_PAY_HOST=https://futopay-test.azurewebsites.net >> .env
- name: Run npm install
run: npm ci
- name: Run build
- name: Build
env:
PUBLIC_IMMICH_PAY_HOST: ${{ env.ENVIRONMENT == 'dev' && 'https://futopay-test.azurewebsites.net' || 'https://pay.futo.org' }}
PUBLIC_CF_TURNSTILE_SITE: ${{ secrets.CF_TURNSTILE_DEFAULT_INVISIBLE_SITE_KEY }}
run: npm run build
run: pnpm build
- name: Upload build output
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: build-frontend-output-${{ matrix.app_name }}
include-hidden-files: true
path: build
path: apps/${{ matrix.app_name }}.immich.app/build
retention-days: 1
build-backend:
@@ -65,22 +67,32 @@ jobs:
strategy:
matrix:
app_name: ['datasets']
defaults:
run:
working-directory: apps/${{ matrix.app_name }}.immich.app/backend
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- name: Setup pnpm
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
- name: Setup Node
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
node-version-file: '.nvmrc'
node-version-file: './.nvmrc'
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- name: Run npm install
run: npm ci
working-directory: 'apps/${{ matrix.app_name }}.immich.app/backend'
- name: Run pnpm install
run: pnpm install
- name: Build backend
run: npx wrangler build
working-directory: 'apps/${{ matrix.app_name }}.immich.app/backend'
- name: Upload build output
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
@@ -96,7 +108,7 @@ jobs:
strategy:
fail-fast: false
matrix:
app_name: ['api', 'root', 'my', 'buy', 'get', 'datasets']
app_name: ['root', 'api', 'my', 'get', 'buy', 'datasets']
env:
TF_VAR_app_name: ${{ matrix.app_name }}
TF_VAR_stage: ${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.number) || '' }}
@@ -104,7 +116,9 @@ jobs:
OP_SERVICE_ACCOUNT_TOKEN: ${{ github.ref == 'refs/heads/main' && secrets.OP_TF_PROD_ENV || secrets.OP_TF_DEV_ENV }}
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- name: Get build artifact
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5
+2 -2
View File
@@ -14,7 +14,7 @@ jobs:
fail-fast: false
matrix:
environment: ['dev', 'prod']
name: ['api', 'root', 'my', 'buy', 'get', 'datasets']
app_name: ['root', 'api', 'my', 'get', 'buy', 'datasets']
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
@@ -37,7 +37,7 @@ jobs:
working-directory: ${{ github.workspace }}/deployment
env:
ENVIRONMENT: ${{ matrix.environment }}
TF_VAR_app_name: ${{ matrix.name }}
TF_VAR_app_name: ${{ matrix.app_name }}
TF_VAR_dist_dir: ${{ github.workspace }}/dist
TF_VAR_stage: pr-${{ github.event.number }}
OP_SERVICE_ACCOUNT_TOKEN: ${{ matrix.environment == 'prod' && secrets.OP_TF_PROD_ENV || secrets.OP_TF_DEV_ENV }}
+28 -22
View File
@@ -15,45 +15,51 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
app_name: ['api', 'root', 'my', 'buy', 'get', 'datasets']
app_name: ['root', 'api', 'my', 'get', 'buy', 'datasets']
defaults:
run:
working-directory: apps/${{ matrix.app_name }}.immich.app
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- name: Setup pnpm
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
- name: Setup Node
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
node-version-file: '.nvmrc'
node-version-file: './.nvmrc'
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- name: Set app
run: |
touch .env
echo IMMICH_APP="${{ matrix.app_name }}.immich.app" >> .env
- name: Install
run: pnpm install
- name: Run npm install
run: npm ci
- name: Run linter
run: npm run lint
- name: Lint
run: pnpm lint
if: ${{ !cancelled() }}
- name: Run formatter
run: npm run format
- name: Format
run: pnpm format
if: ${{ !cancelled() }}
- name: Run tsc
run: npm run check
- name: Type check
run: pnpm check
if: ${{ !cancelled() }}
- name: Run unit tests
run: npm test
- name: Test
run: pnpm test
if: ${{ !cancelled() }}
- name: Check for app backend
id: check-backend
run: |
if [ -d "apps/${{ matrix.app_name }}.immich.app/backend" ]; then
if [ -d "backend" ]; then
echo "has_backend=true" >> $GITHUB_ENV
else
echo "has_backend=false" >> $GITHUB_ENV
@@ -63,5 +69,5 @@ jobs:
if: ${{ env.has_backend == 'true' }}
working-directory: 'apps/${{ matrix.app_name }}.immich.app/backend'
run: |
npm ci
npm test
pnpm install
pnpm test