From 53193613a64958358d8a4cad85a9c0a18ff12277 Mon Sep 17 00:00:00 2001 From: ZL Asica <40444637+ZL-Asica@users.noreply.github.com> Date: Sat, 30 May 2026 00:47:10 -0500 Subject: [PATCH 1/2] ci: reuse Node and pnpm setup action --- .github/actions/setup-node-pnpm/action.yml | 29 +++++++++++ .github/workflows/deploy-production.yml | 15 +----- .github/workflows/pr-checks.yml | 60 +++------------------- .github/workflows/pr-preview.yml | 15 +----- 4 files changed, 41 insertions(+), 78 deletions(-) create mode 100644 .github/actions/setup-node-pnpm/action.yml diff --git a/.github/actions/setup-node-pnpm/action.yml b/.github/actions/setup-node-pnpm/action.yml new file mode 100644 index 00000000..d3a7a24e --- /dev/null +++ b/.github/actions/setup-node-pnpm/action.yml @@ -0,0 +1,29 @@ +name: Setup Node and pnpm +description: Install pnpm, configure Node.js with pnpm cache, and optionally install dependencies. + +inputs: + node-version: + description: Node.js version passed to actions/setup-node. + default: lts/* + install: + description: Whether to run pnpm install. + default: 'true' + +runs: + using: composite + steps: + - name: ๐Ÿงฐ Setup pnpm + uses: pnpm/action-setup@v4 + with: + package_json_file: package.json + + - name: ๐Ÿงฑ Setup Node (cache pnpm) + uses: actions/setup-node@v4 + with: + node-version: ${{ inputs.node-version }} + cache: pnpm + + - name: ๐Ÿ“ฆ Install deps (frozen) + if: inputs.install == 'true' + shell: bash + run: pnpm install --frozen-lockfile diff --git a/.github/workflows/deploy-production.yml b/.github/workflows/deploy-production.yml index 9f2efc06..22463cea 100644 --- a/.github/workflows/deploy-production.yml +++ b/.github/workflows/deploy-production.yml @@ -35,19 +35,8 @@ jobs: with: fetch-depth: 0 - - name: ๐Ÿงฐ Setup pnpm - uses: pnpm/action-setup@v4 - with: - package_json_file: package.json - - - name: ๐Ÿงฑ Setup Node (cache pnpm) - uses: actions/setup-node@v4 - with: - node-version: 'lts/*' - cache: pnpm - - - name: ๐Ÿ“ฆ Install deps (frozen) - run: pnpm install --frozen-lockfile + - name: ๐Ÿงฑ Setup Node and pnpm + uses: ./.github/actions/setup-node-pnpm - name: ๐Ÿšจ Lint Code run: pnpm run lint:ci diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index 182e670c..a5dafc94 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -22,19 +22,8 @@ jobs: - name: ๐Ÿ“‚ Checkout uses: actions/checkout@v4 - - name: ๐Ÿงฐ Setup pnpm - uses: pnpm/action-setup@v4 - with: - package_json_file: package.json - - - name: ๐Ÿงฑ Setup Node (cache pnpm) - uses: actions/setup-node@v4 - with: - node-version: 'lts/*' - cache: pnpm - - - name: ๐Ÿ“ฆ Install deps (frozen) - run: pnpm install --frozen-lockfile + - name: ๐Ÿงฑ Setup Node and pnpm + uses: ./.github/actions/setup-node-pnpm - name: ๐Ÿšจ Run lint run: pnpm run lint:ci @@ -50,19 +39,8 @@ jobs: - name: ๐Ÿ“‚ Checkout uses: actions/checkout@v4 - - name: ๐Ÿงฐ Setup pnpm - uses: pnpm/action-setup@v4 - with: - package_json_file: package.json - - - name: ๐Ÿงฑ Setup Node (cache pnpm) - uses: actions/setup-node@v4 - with: - node-version: 'lts/*' - cache: pnpm - - - name: ๐Ÿ“ฆ Install deps (frozen) - run: pnpm install --frozen-lockfile + - name: ๐Ÿงฑ Setup Node and pnpm + uses: ./.github/actions/setup-node-pnpm - name: ๐Ÿงช Run unit tests run: pnpm run test:unit @@ -97,19 +75,8 @@ jobs: - name: ๐Ÿ“‚ Checkout uses: actions/checkout@v4 - - name: ๐Ÿงฐ Setup pnpm - uses: pnpm/action-setup@v4 - with: - package_json_file: package.json - - - name: ๐Ÿงฑ Setup Node (cache pnpm) - uses: actions/setup-node@v4 - with: - node-version: 'lts/*' - cache: pnpm - - - name: ๐Ÿ“ฆ Install deps (frozen) - run: pnpm install --frozen-lockfile + - name: ๐Ÿงฑ Setup Node and pnpm + uses: ./.github/actions/setup-node-pnpm - name: ๐ŸŽญ Install Playwright browsers run: pnpm run test:e2e:install @@ -229,19 +196,8 @@ jobs: - name: ๐Ÿ“‚ Checkout uses: actions/checkout@v4 - - name: ๐Ÿงฐ Setup pnpm - uses: pnpm/action-setup@v4 - with: - package_json_file: package.json - - - name: ๐Ÿงฑ Setup Node (cache pnpm) - uses: actions/setup-node@v4 - with: - node-version: 'lts/*' - cache: pnpm - - - name: ๐Ÿ“ฆ Install deps (frozen) - run: pnpm install --frozen-lockfile + - name: ๐Ÿงฑ Setup Node and pnpm + uses: ./.github/actions/setup-node-pnpm - name: ๐Ÿ—๏ธ Run build run: pnpm run build diff --git a/.github/workflows/pr-preview.yml b/.github/workflows/pr-preview.yml index 277ad59b..69e2bedd 100644 --- a/.github/workflows/pr-preview.yml +++ b/.github/workflows/pr-preview.yml @@ -34,19 +34,8 @@ jobs: - name: ๐Ÿ“‚ Checkout uses: actions/checkout@v4 - - name: ๐Ÿงฐ Setup pnpm - uses: pnpm/action-setup@v4 - with: - package_json_file: package.json - - - name: ๐Ÿงฑ Setup Node (cache pnpm) - uses: actions/setup-node@v4 - with: - node-version: 'lts/*' - cache: pnpm - - - name: ๐Ÿ“ฆ Install deps (frozen) - run: pnpm install --frozen-lockfile + - name: ๐Ÿงฑ Setup Node and pnpm + uses: ./.github/actions/setup-node-pnpm - name: ๐Ÿ—๏ธ Run build run: pnpm run build From 6c724d904cd7da940ed4fa13a254a65dc1ec2719 Mon Sep 17 00:00:00 2001 From: ZL Asica <40444637+ZL-Asica@users.noreply.github.com> Date: Sat, 30 May 2026 00:48:11 -0500 Subject: [PATCH 2/2] ci: keep Supabase project active --- .github/workflows/keep-supabase-alive.yml | 44 +++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/keep-supabase-alive.yml diff --git a/.github/workflows/keep-supabase-alive.yml b/.github/workflows/keep-supabase-alive.yml new file mode 100644 index 00000000..49c21aa7 --- /dev/null +++ b/.github/workflows/keep-supabase-alive.yml @@ -0,0 +1,44 @@ +name: ๐Ÿซ€ Keep Supabase Alive + +on: + schedule: + # Run at midnight UTC on Sunday and Friday. + - cron: '0 0 * * 0,5' + workflow_dispatch: + +concurrency: + group: keep-supabase-alive + cancel-in-progress: false + +permissions: {} + +jobs: + ping: + name: ๐Ÿซ€ Ping Supabase REST API + runs-on: ubuntu-latest + timeout-minutes: 5 + env: + SUPABASE_URL: ${{ secrets.VITE_SUPABASE_URL }} + SUPABASE_SECRET_KEY: ${{ secrets.SUPABASE_SECRET_KEY }} + + steps: + - name: ๐Ÿซ€ Ping profile table + shell: bash + run: | + set -euo pipefail + + if [ -z "${SUPABASE_URL:-}" ] || [ -z "${SUPABASE_SECRET_KEY:-}" ]; then + echo "::error::VITE_SUPABASE_URL and SUPABASE_SECRET_KEY secrets are required." + exit 1 + fi + + base_url="${SUPABASE_URL%/}" + + curl --fail --show-error --silent \ + --retry 3 \ + --retry-delay 5 \ + --max-time 20 \ + "${base_url}/rest/v1/profile?select=id&limit=1" \ + -H "apikey: ${SUPABASE_SECRET_KEY}" \ + -H "Accept: application/json" \ + --output /dev/null