From e53b3e0fc169a8d2359f5f742f57d38389262f22 Mon Sep 17 00:00:00 2001 From: Branimir Georgiev Date: Sun, 11 Aug 2024 17:42:59 +0300 Subject: [PATCH] (#12) - Add the documentation pipeline --- .github/workflows/deploy_pages.yml | 59 ++++++++++++++++++++---------- 1 file changed, 39 insertions(+), 20 deletions(-) diff --git a/.github/workflows/deploy_pages.yml b/.github/workflows/deploy_pages.yml index f2c9e97..dd2987e 100644 --- a/.github/workflows/deploy_pages.yml +++ b/.github/workflows/deploy_pages.yml @@ -1,13 +1,20 @@ # Simple workflow for deploying static content to GitHub Pages -name: Deploy static content to Pages - +name: Deploy Pages on: - # Runs on pushes targeting the default branch + # Trigger the deployment manually + workflow_dispatch: + + # Trigger the deployment on push to the main branch push: - branches: ["main"] - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: + # Only the main branch + branches: + - "main" + + # Only when the docs directory or mkdocs.yml file changes + paths: + - "docs/**" + - mkdocs.yml # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: @@ -15,29 +22,41 @@ permissions: 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. +# Allow one concurrent deployment concurrency: group: "pages" - cancel-in-progress: false + cancel-in-progress: true +# Define the jobs that run in the workflow jobs: - # Single deploy job since we're just deploying + + # The build job + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - run: ls -la + - name: Setup Pages + uses: actions/configure-pages@v2 + - name: Setup Python, install plugins, and build site + uses: actions/setup-python@v4 + with: + python-version: 3.x + - run: pip install mkdocs + - run: pip install mkdocs-section-index + - run: mkdocs build --site-dir ./_site + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 + + # The deployment job deploy: environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest + needs: build steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Setup Pages - uses: actions/configure-pages@v5 - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 - with: - # Upload entire repository - path: '.' - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v4 + uses: actions/deploy-pages@v1