Skip to content

Commit

Permalink
Merge pull request #61 from geoneric/gh36
Browse files Browse the repository at this point in the history
Add workflow for adding web-app and documentation to GH pages
  • Loading branch information
kordejong authored Jan 24, 2025
2 parents 87306ae + 6bac53c commit fcb8d07
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 50 deletions.
80 changes: 80 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Deploy

# https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site

on:
pull_request:
push:
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

defaults:
run:
shell: bash -l {0}

jobs:
build:
runs-on: ubuntu-latest
env:
python_version: 3.12
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.python_version }}
cache: "pip"
cache-dependency-path: "**/requirements*.txt"
- name: Install Python packages
run: |
pip install \
-r environment/configuration/requirements.txt \
-r environment/configuration/requirements-dev.txt
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: "3.24.5"
channel: "stable"
cache: true
- name: Configure project and generate build system
run: |
mkdir build
cd build
cmake -S .. -G Ninja
- name: Build web app
run: |
cmake --build build --target web_app
- name: Generate documentation
run: |
cmake --build build --target documentation
mv build/documentation/html build/source/package/pathways_app/build/web/doc
deploy:
if: github.repository == 'Deltares-research/PathwaysGenerator' && github.ref == 'refs/heads/main'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Setup pages
id: pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: build/source/package/pathways_app/build/web
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
5 changes: 0 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ jobs:
- { os: "ubuntu-24.04", arch: x64 }
- { os: "windows-2022", arch: x64 }
steps:
- name: Setup Linux platform
if: ${{ startsWith(matrix.platform.os, 'ubuntu') }}
run: |
sudo apt-get update
sudo apt-get install libegl1
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
Expand Down
45 changes: 0 additions & 45 deletions .github/workflows/web_app.yml

This file was deleted.

0 comments on commit fcb8d07

Please sign in to comment.