-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (46 loc) · 1.9 KB
/
build_main.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Build schemas
# when main changed rebuild the products (schemas and documentations) and updates the build folder
on:
push:
branches: [ main ]
permissions: write-all
jobs:
build-and-publish:
name: Build main branch
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.9' ]
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token.
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
run: |
pipx install poetry
- name: Install dependencies
run: |
poetry install --no-interaction
- name: Generate merged schemas
run: |
make merged_schemas
- name: Run schema_expander.py
run: |
poetry run python src/cell_annotation_schema/schema_expander.py expand -i build/general_schema.yaml -o build/general_schema.yaml
poetry run python src/cell_annotation_schema/schema_expander.py expand -i build/BICAN_schema.yaml -o build/BICAN_schema.yaml
poetry run python src/cell_annotation_schema/schema_expander.py expand -i build/CAP_schema.yaml -o build/CAP_schema.yaml
- name: Commit files
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git diff --quiet && git diff --staged --quiet || git commit -a -m "Main branch build"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.P_TOKEN }}
branch: ${{ github.head_ref }}