From 5cf5c260bec6a8d95ce448041a0787e1bb3e0089 Mon Sep 17 00:00:00 2001 From: Martin Tobias Degner Date: Wed, 4 Sep 2024 14:44:35 +0200 Subject: [PATCH] updated sphinx build and deploy --- .github/workflows/sphinx-pages.yml | 49 ++++++++---------------------- .github/workflows/static.yml | 46 ---------------------------- 2 files changed, 13 insertions(+), 82 deletions(-) delete mode 100644 .github/workflows/static.yml diff --git a/.github/workflows/sphinx-pages.yml b/.github/workflows/sphinx-pages.yml index c0c0d3146..8d384a239 100644 --- a/.github/workflows/sphinx-pages.yml +++ b/.github/workflows/sphinx-pages.yml @@ -1,46 +1,23 @@ -# This is a basic workflow to help you get started with Actions - -name: CI - -# Controls when the workflow will run -on: - # Triggers the workflow on push or pull request events but only for the "main" branch - push: - branches: [ "gh-pages2" ] - pull_request: - branches: [ "main" ] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel +name: Build and Deploy +on: [push] +permissions: + contents: write jobs: - # This workflow contains a single job called "build" - build: - # The type of runner that the job will run on + build-and-deploy: + concurrency: ci-${{ github.ref }} # Recommended if you intend to make multiple deployments in quick succession. runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4 - - # Runs a single command using the runners shell - - name: Run a one-line script - run: echo Hello, world! + - name: Checkout 🛎️ + uses: actions/checkout@v4 - uses: actions/setup-python@v5 - name: Install dependencies run: | - pip install sphinx sphinx_rtd_theme myst_parser sphinxcontrib.mermaid + pip install sphinx sphinx_rtd_theme myst_parser sphinxcontrib-mermaid - name: Sphinx build run: | - sphinx-build webcentral/doc/06_sphinx/source _build - - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v3 - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} + sphinx-build webcentral/doc/06_sphinx _build + - name: Deploy 🚀 + uses: JamesIves/github-pages-deploy-action@v4 with: - publish_branch: gh-pages - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: _build/ - force_orphan: true + folder: build # The folder the action should deploy. diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml deleted file mode 100644 index 4621b3299..000000000 --- a/.github/workflows/static.yml +++ /dev/null @@ -1,46 +0,0 @@ -# Simple workflow for deploying static content to GitHub Pages -name: Deploy static content to Pages - -on: - # Runs on pushes targeting the default branch - push: - branches: ["main"] - - # Allows you to run this workflow manually from the Actions tab - 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 - -jobs: - # Single deploy job since we're just deploying - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - steps: - - uses: actions/setup-python@v5 - - name: Install dependencies - run: | - pip install sphinx sphinx_rtd_theme myst_parser - - name: Sphinx build - run: | - sphinx-build webcentral/doc/06_sphinx _build - - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v3 - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} - with: - publish_branch: gh-pages - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: _build/ - force_orphan: true