From a28411e9857c56e3be9684ebe496e52cb9c1786a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A9r=C3=A9nice=20Batut?= Date: Wed, 4 Dec 2024 11:47:14 +0100 Subject: [PATCH] Changes to Jekyll CI --- .github/workflows/jekyll.yml | 54 ++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 30 deletions(-) diff --git a/.github/workflows/jekyll.yml b/.github/workflows/jekyll.yml index cbd56fdb..d6824971 100644 --- a/.github/workflows/jekyll.yml +++ b/.github/workflows/jekyll.yml @@ -1,71 +1,65 @@ -name: Jekyll site CI +name: Deploy Jekyll site to Pages on: + # Runs on pushes targeting the default branch push: - branches: [ main, master ] - pull_request: - branches: [ main, master ] + 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: build: - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest + defaults: + run: + working-directory: docs steps: - name: Checkout uses: actions/checkout@v3 - with: - ref: ${{ github.event.inputs.branch }} - - name: Setup Ruby uses: ruby/setup-ruby@v1.196.0 with: ruby-version: '3.3' bundler-cache: true cache-version: 0 - - name: Setup Pages id: pages - uses: actions/configure-pages@v2 - + uses: actions/configure-pages@v3 - name: Install dependencies run: | bundle install - - name: Build with Jekyll # Outputs to the './_site' directory by default run: | bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}" env: - PAGES_REPO_NWO: ${{ github.repository }} JEKYLL_ENV: production - JEKYLL_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - JEKYLL_BUILD_BRANCH: ${{ github.ref_name }} - JEKYLL_BASE_PATH: ${{ steps.pages.outputs.base_path }} - - name: Upload artifact - uses: actions/upload-pages-artifact@v1 + # Automatically uploads an artifact from the './_site' directory by default + uses: actions/upload-pages-artifact@v2 deploy: - runs-on: ubuntu-latest - needs: build - - if: | - github.event_name == 'workflow_dispatch' || - (github.event_name == 'push' && github.event.repository.default_branch == github.ref_name) - concurrency: - group: "pages" - cancel-in-progress: true - environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} - + runs-on: ubuntu-latest + defaults: + run: + working-directory: docs + needs: build steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v1 \ No newline at end of file + uses: actions/deploy-pages@v2