diff --git a/.github/workflows/create_pr_preview.yml b/.github/workflows/create_pr_preview.yml index 8b2511a4d..5246b777d 100644 --- a/.github/workflows/create_pr_preview.yml +++ b/.github/workflows/create_pr_preview.yml @@ -8,7 +8,7 @@ on: - synchronize concurrency: - group: preview-${{ github.ref }} + group: preview-${{ github.event.number }} cancel-in-progress: true env: @@ -32,13 +32,13 @@ jobs: run: pip install -r requirements.txt - name: Build preview website - run: mkdocs build -f mkdocs.yml -d pr_preview + run: mkdocs build -f mkdocs.yml -d website - name: Add preview on gh-pages branch uses: JamesIves/github-pages-deploy-action@v4 with: branch: ${{ env.TARGET_BRANCH }} - folder: pr_preview + folder: website target-folder: ${{ env.TARGET_FOLDER }} commit-message: Deploy preview for PR ${{ env.PR }} 🛫 force: false diff --git a/.github/workflows/deploy_development_website.yml b/.github/workflows/deploy_development_website.yml new file mode 100644 index 000000000..a393d8432 --- /dev/null +++ b/.github/workflows/deploy_development_website.yml @@ -0,0 +1,45 @@ +name: Deploy development website + +on: + push: + branches: + - development + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +concurrency: + group: deploy-development + cancel-in-progress: true + +env: + TARGET_FOLDER: development_website + TARGET_BRANCH: gh-pages + +jobs: + build-and-deploy-preview: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Python setup + uses: actions/setup-python@v4 + with: + python-version: 3.x + + - name: Install dependencies + run: pip install -r requirements.txt + + - name: Build preview website + run: mkdocs build -f mkdocs.yml -d website + + - name: Add preview on gh-pages branch + uses: JamesIves/github-pages-deploy-action@v4 + with: + branch: ${{ env.TARGET_BRANCH }} + folder: website + target-folder: ${{ env.TARGET_FOLDER }} + commit-message: Deploy development website. 🛫 + force: false + + # - name: Deploy to Github pages \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f08c55776..6846cbdd7 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -12,9 +12,12 @@ permissions: # 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" + group: publish-website cancel-in-progress: false +env: + TARGET_BRANCH: gh-pages + jobs: build-and-deploy: concurrency: ci-${{ github.ref }} @@ -36,8 +39,10 @@ jobs: uses: JamesIves/github-pages-deploy-action@v4 with: folder: website - branch: gh-pages # default - clean-exclude: pr-preview/ # don't overwrite previews + branch: ${{ env.TARGET_BRANCH }} + clean-exclude: | + pr-preview/ + development_website/ # deploy: # needs: build diff --git a/docs/js/miscellaneous.js b/docs/js/miscellaneous.js index 7689a8534..afe0836c8 100644 --- a/docs/js/miscellaneous.js +++ b/docs/js/miscellaneous.js @@ -6,16 +6,6 @@ function sortTables() { tables.forEach(table => new Tablesort(table)); } -/* - Remove 'edit' and 'view' icons from homepage -*/ -function removeIconsFromHomepage() { - if (location.pathname.match('^(/|/development_site/|/pr-preview/pr-[0-9]*/)$')) { - let icons=document.querySelectorAll(".md-content__button.md-icon"); - icons.forEach(icon=>icon.style.display="none"); - } -} - /* Adjust the scrolling so that the paragraph's titles is not partially covered by the sticky banner when clicking on a toc link diff --git a/mkdocs.yml b/mkdocs.yml index c3d8fa880..5ff66aae6 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -40,8 +40,6 @@ theme: - navigation.indexes - navigation.footer - navigation.tracking # The URL in the address bar is automatically updated with active anchor - - content.action.edit - - content.action.view - content.code.copy # for displaying copy icon at top right in code snippets - content.code.annotate - content.tabs.link