From ac3deb113e343e2f211e4d08bdf6aac3ef0e120c Mon Sep 17 00:00:00 2001 From: Mythie Date: Thu, 27 Mar 2025 22:49:12 +1100 Subject: [PATCH] chore: update ci --- .github/actions/cache-build/action.yml | 23 --------------- .github/workflows/ci.yml | 3 +- .github/workflows/clean-cache.yml | 29 ------------------- .github/workflows/codeql-analysis.yml | 5 ++-- .github/workflows/e2e-tests.yml | 3 +- apps/remix/.bin/build.sh | 4 +-- .../routes/_authenticated+/admin+/stats.tsx | 4 +-- 7 files changed, 11 insertions(+), 60 deletions(-) delete mode 100644 .github/actions/cache-build/action.yml delete mode 100644 .github/workflows/clean-cache.yml diff --git a/.github/actions/cache-build/action.yml b/.github/actions/cache-build/action.yml deleted file mode 100644 index af89fedef..000000000 --- a/.github/actions/cache-build/action.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Cache production build binaries -description: 'Cache or restore if necessary' -inputs: - node_version: - required: false - default: v22.x -runs: - using: 'composite' - steps: - - name: Cache production build - uses: actions/cache@v3 - id: production-build-cache - with: - path: | - ${{ github.workspace }}/apps/web/.next - **/.turbo/** - **/dist/** - - key: prod-build-${{ github.run_id }}-${{ hashFiles('package-lock.json') }} - restore-keys: prod-build- - - - run: npm run build - shell: bash diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6101b0180..3a7afc44f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,8 @@ jobs: - name: Copy env run: cp .env.example .env - - uses: ./.github/actions/cache-build + - name: Build app + run: npm run build build_docker: name: Build Docker Image diff --git a/.github/workflows/clean-cache.yml b/.github/workflows/clean-cache.yml deleted file mode 100644 index 2cb13f661..000000000 --- a/.github/workflows/clean-cache.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: cleanup caches by a branch -on: - pull_request: - types: - - closed - -jobs: - cleanup: - runs-on: ubuntu-latest - steps: - - name: Cleanup - run: | - gh extension install actions/gh-actions-cache - - echo "Fetching list of cache key" - cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH -L 100 | cut -f 1 ) - - ## Setting this to not fail the workflow while deleting cache keys. - set +e - echo "Deleting caches..." - for cacheKey in $cacheKeysForPR - do - gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm - done - echo "Done" - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - REPO: ${{ github.repository }} - BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 88692396f..d74f30387 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -10,7 +10,7 @@ on: jobs: analyze: name: Analyze - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest permissions: actions: read contents: read @@ -30,7 +30,8 @@ jobs: - uses: ./.github/actions/node-install - - uses: ./.github/actions/cache-build + - name: Build app + run: npm run build - name: Initialize CodeQL uses: github/codeql-action/init@v3 diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 9d935d83f..5a33362a9 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -28,7 +28,8 @@ jobs: - name: Seed the database run: npm run prisma:seed - - uses: ./.github/actions/cache-build + - name: Build app + run: npm run build - name: Run Playwright tests run: npm run ci diff --git a/apps/remix/.bin/build.sh b/apps/remix/.bin/build.sh index d7e4c6134..ada8e5525 100755 --- a/apps/remix/.bin/build.sh +++ b/apps/remix/.bin/build.sh @@ -1,7 +1,7 @@ -#!/usr/bin/env sh +#!/usr/bin/env bash # Exit on error. -set -eo pipefail +set -e SCRIPT_DIR="$(readlink -f "$(dirname "$0")")" WEB_APP_DIR="$SCRIPT_DIR/.." diff --git a/apps/remix/app/routes/_authenticated+/admin+/stats.tsx b/apps/remix/app/routes/_authenticated+/admin+/stats.tsx index e511e2caf..b3141e49d 100644 --- a/apps/remix/app/routes/_authenticated+/admin+/stats.tsx +++ b/apps/remix/app/routes/_authenticated+/admin+/stats.tsx @@ -23,12 +23,12 @@ import { getUsersWithSubscriptionsCount, } from '@documenso/lib/server-only/admin/get-users-stats'; import { getSignerConversionMonthly } from '@documenso/lib/server-only/user/get-signer-conversion'; -import { env } from '@documenso/lib/utils/env'; import { AdminStatsSignerConversionChart } from '~/components/general/admin-stats-signer-conversion-chart'; import { AdminStatsUsersWithDocumentsChart } from '~/components/general/admin-stats-users-with-documents'; import { CardMetric } from '~/components/general/metric-card'; +import { version } from '../../../../package.json'; import type { Route } from './+types/stats'; export async function loader() { @@ -89,7 +89,7 @@ export default function AdminStatsPage({ loaderData }: Route.ComponentProps) { value={usersWithSubscriptionsCount} /> - +