mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2026-01-18 10:51:28 +00:00
53 lines
1.5 KiB
YAML
53 lines
1.5 KiB
YAML
name: CI Cache Verification
|
|
|
|
on:
|
|
push:
|
|
paths:
|
|
- '.github/workflows/cache-verify.yml'
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
verify-cache:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
- run: echo "key=node-modules-${{ runner.os }}-${{ env.LOCK_HASH }}" >> $GITHUB_OUTPUT
|
|
id: cache-key
|
|
env: { LOCK_HASH: ${{ hashFiles('backend/yarn.lock', 'webapp/yarn.lock') }} }
|
|
- uses: actions/cache@v4
|
|
id: restore
|
|
with:
|
|
path: |
|
|
backend/node_modules
|
|
webapp/node_modules
|
|
key: ${{ steps.cache-key.outputs.key }}
|
|
restore-keys: |
|
|
node-modules-${{ runner.os }}-
|
|
node-modules-
|
|
- run: echo "Cache: ${{ steps.restore.outputs.cache-hit }}"
|
|
- run: cd backend && yarn install && yarn build
|
|
- run: cd webapp && yarn install && yarn build
|
|
|
|
verify-wait:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with: { node-version: '20' }
|
|
- run: cd webapp && yarn install && yarn build
|
|
- run: |
|
|
if [ -d webapp/out ]; then
|
|
npx serve -s webapp/out -l 3000 &
|
|
else
|
|
cd webapp && yarn start &
|
|
fi
|
|
- run: |
|
|
for i in {1..15}; do
|
|
curl -sf http://localhost:3000 && echo "✅ up" && exit 0
|
|
echo "$i..." && sleep 2
|
|
done
|
|
echo "❌ no response" && exit 1
|