Backup scripts #77
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: frontend checks | |
on: | |
push: | |
branches: | |
- main | |
- mwp_v1 | |
pull_request: | |
paths: | |
- ".github/**" | |
- "docker/**" | |
- "frontend/**" | |
jobs: | |
frontend-checks: | |
runs-on: self-hosted | |
env: | |
API_WORKERS: 1 | |
VITE_APP_SERVER: http://localhost:13120 | |
COMPOSE_PROFILES: "ray,background,backend,frontend" | |
RAY_CONFIG: "config_gpu.yaml" | |
JWT_SECRET: ${{ secrets.JWT_SECRET }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Checkout PR | |
if: github.event_name == 'pull_request' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: gh pr checkout ${{ github.event.pull_request.number }} | |
- name: Prepare environment | |
working-directory: docker | |
run: | | |
./setup-folders.sh | |
cp .env.example .env | |
sed -i 's/COMPOSE_PROJECT_NAME=demo/COMPOSE_PROJECT_NAME=action-runner/' .env | |
sed -i 's/\(DATS_FRONTEND_DOCKER_VERSION=[0-9.]*\)/\1-${{ github.run_id }}/' .env | |
sed -i "s/UID=121/UID=$(id -u)/" .env | |
sed -i "s/GID=126/GID=$(id -g)/" .env | |
echo "SPACY_CACHE_DIR=$HOME/spacy_models" >> .env | |
echo "MODELS_CACHE_DIR=$HOME/models_cache" >> .env | |
mkdir -p $HOME/spacy_models | |
mkdir -p $HOME/models_cache | |
- name: Build & Start Docker Containers | |
working-directory: docker | |
run: | | |
docker compose build dats-frontend | |
docker compose up --wait --quiet-pull | |
- name: Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: npm | |
cache-dependency-path: frontend/package-lock.json | |
- name: Install dependencies | |
working-directory: frontend | |
run: npm ci | |
- name: Check 1 - api client is up-to-date | |
working-directory: frontend | |
run: | | |
npm run update-api | |
npm run generate-api | |
- name: Add and commit changes | |
uses: EndBug/add-and-commit@v9 | |
if: github.event_name == 'pull_request' | |
with: | |
add: "frontend/src/api" | |
message: "Update OpenAPI spec and client" | |
pathspec_error_handling: exitImmediately | |
default_author: github_actions | |
- name: Cleanup | |
working-directory: docker | |
if: always() | |
run: | | |
docker compose down -v | |
FRONTEND_IMAGE=uhhlt/dats_frontend:$(grep -oP 'DATS_FRONTEND_DOCKER_VERSION=\K.*' .env) | |
docker rmi $FRONTEND_IMAGE |