Skip to content

Update deploy.yml

Update deploy.yml #3

Workflow file for this run

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
- name: Setup pages
if: github.repository == 'Deltares-research/PathwaysGenerator' && github.ref == 'refs/heads/main'
id: pages
uses: actions/configure-pages@v5
- name: Upload artifact
if: github.repository == 'Deltares-research/PathwaysGenerator' && github.ref == 'refs/heads/main'
uses: actions/upload-pages-artifact@v3
with:
path: build/source/package/pathways_app/build/web
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: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4