From d89d1143a530968da74894897a307a7a6ab7ba8a Mon Sep 17 00:00:00 2001 From: Felipe Olmos <92923444+folmos-at-orange@users.noreply.github.com> Date: Wed, 11 Dec 2024 17:21:44 +0100 Subject: [PATCH] Make manual the CI website deployment --- .github/workflows/ci.yml | 36 +++++++++++++++++++++++++----------- README.md | 3 ++- 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 77d3145..34639de 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,28 +1,42 @@ --- -name: ci +name: Website on: - push: - branches: [master, main] + workflow_dispatch: + inputs: + deploy-gh-pages: + description: Deploy to GH Pages + required: true + type: boolean + default: true + pull_request: permissions: contents: write jobs: - deploy: + build-or-deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + with: + python-version: 3.x + - name: Install requirements + run: pip install -r requirements.txt - name: Configure Git Credentials run: | git config user.name github-actions[bot] git config user.email 41898282+github-actions[bot]@users.noreply.github.com - - uses: actions/setup-python@v4 - with: - python-version: 3.x - - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV - - uses: actions/cache@v3 + - name: Set Cache ID + run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV + - name: Cache mkdocs-material + uses: actions/cache@v3 with: key: mkdocs-material-${{ env.cache_id }} path: .cache restore-keys: | mkdocs-material- - - run: pip install mkdocs-material mkdocs-jupyter - - run: mkdocs gh-deploy --force + - name: Build site + if: github.event_name == 'pull_request' || inputs.deploy-gh-pages == false + run: mkdocs build + - name: Deploy site to GH pages + if: github.event_name == 'workflow_dispatch' && inputs.deploy-gh-pages == true + run: mkdocs gh-deploy --force diff --git a/README.md b/README.md index 1836971..1977e55 100644 --- a/README.md +++ b/README.md @@ -44,4 +44,5 @@ To update various versions in the website, you only have to change the following ## Deploy to khiops.org -Once you have committed and pushed your changes. Use the `ci` workflow in the repo's actions. +Once you have committed and pushed your changes, go to the "Actions" tab on Github and execute the +`Website` workflow on the `main` branch.