Merge pull request #7 from SophieCurinier/Charles #44
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: CI/CD | |
on: | |
push: | |
branches: [ "main"] | |
pull_request: | |
branches: [ "main" ] | |
permissions: | |
contents: read | |
defaults: | |
run: | |
working-directory: ./oml-eds | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup JDK | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
- name: Build | |
run: ./gradlew build | |
- name: Query | |
run: ./gradlew owlQuery | |
- name: Upload | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: build | |
path: oml-eds/build/ | |
- name: Generate Docs | |
run: ./gradlew generateDocs | |
- name: Set up Python 3 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install Requirements | |
run: pip install -r src/ipynb/requirements.txt | |
- name: Run Notebook | |
run: python -m nbconvert --execute --to notebook --no-input src/ipynb/index.ipynb --output-dir='build/web' | |
- name: Convert Notebook to HTML | |
run: python -m nbconvert --to html --no-input build/web/index.ipynb | |
- name: Publish | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
path: oml-eds/build/web | |
deploy: | |
needs: build | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy | |
id: deployment | |
uses: actions/deploy-pages@v1 |