Skip to content

Commit

Permalink
ci: adapt json schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
flomonster authored and Akctarus committed Aug 26, 2022
1 parent aceaad5 commit cab910c
Showing 1 changed file with 27 additions and 5 deletions.
32 changes: 27 additions & 5 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,36 @@ jobs:
with:
python-version: '3.9'

- name: Install Geojson-Pydantic
run: pip install geojson-pydantic==0.4.3
- name: Install GDAL
run: sudo apt-get install -y gdal-bin

- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-in-project: true

- name: Clone OSRD repository
run: git clone https://github.com/DGEXSolutions/osrd.git /tmp/osrd_repo

- name: Load cached venv
uses: actions/cache@v3
id: cached-poetry-dependencies
with:
path: /tmp/osrd_repo/api/.venv
key: osrd-api-venv-${{ hashFiles('/tmp/osrd_repo/api/poetry.lock') }}

- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: |
cd /tmp/osrd_repo/api
poetry install --no-interaction --no-root -E production
- name: Add JSON schemas
run: |
git clone https://github.com/DGEXSolutions/osrd.git /tmp/osrd_repo
mkdir public/schemas
python /tmp/osrd_repo/api/osrd_infra/schemas/infra.py > public/schemas/infra_schema.json
source /tmp/osrd_repo/api/.venv/bin/activate
mkdir -p public/schemas
python /tmp/osrd_repo/api/manage.py json_schema infra > public/schemas/infra_schema.json
python /tmp/osrd_repo/api/manage.py json_schema rolling_stock > public/schemas/rolling_stock_schema.json
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
Expand Down

0 comments on commit cab910c

Please sign in to comment.