optimize CI times

This commit is contained in:
Yeicor
2024-03-03 20:34:52 +01:00
parent 075682ff18
commit 258256912b
3 changed files with 9 additions and 7 deletions

View File

@@ -37,8 +37,8 @@ jobs:
with:
python-version: "3.11"
cache: "poetry"
- run: "poetry install"
- run: "poetry build"
- run: "SKIP_BUILD_FRONTEND=true poetry install"
- run: "SKIP_BUILD_FRONTEND=true poetry build"
build-logo:
name: "Build logo"
@@ -53,7 +53,7 @@ jobs:
with:
python-version: "3.11"
cache: "poetry"
- run: "poetry install"
- run: "SKIP_BUILD_FRONTEND=true poetry install"
- run: "poetry run python yacv_server/logo.py"
- run: "cp assets/fox.glb assets/logo_build/fox.glb"
- uses: "actions/upload-artifact@v4"

View File

@@ -17,7 +17,7 @@ concurrency:
cancel-in-progress: false
jobs:
deploy:
deploy-frontend:
runs-on: "ubuntu-latest"
environment:
name: "github-pages"
@@ -50,3 +50,4 @@ jobs:
- id: "deployment"
uses: "actions/deploy-pages@v4"
# TODO: deploy-backend

View File

@@ -2,6 +2,7 @@ import os
import subprocess
if __name__ == "__main__":
# When building the backend, make sure the frontend is built first
subprocess.run(['yarn', 'install'], check=True)
subprocess.run(['yarn', 'build', '--outDir', 'yacv_server/frontend'], check=True)
if os.getenv('SKIP_BUILD_FRONTEND') is None:
# When building the backend, make sure the frontend is built first
subprocess.run(['yarn', 'install'], check=True)
subprocess.run(['yarn', 'build', '--outDir', 'yacv_server/frontend'], check=True)