From 0dcf02a0c9fcf38631eccb955116b135092fefba Mon Sep 17 00:00:00 2001 From: olaf michaelis Date: Thu, 30 Jan 2025 16:13:41 +0100 Subject: [PATCH] Fix and simplify build workflow --- .github/workflows/pages.yml | 46 +++++++++++++++---------------------- 1 file changed, 19 insertions(+), 27 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index e1f53bb5..465b99bd 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -1,58 +1,50 @@ --- -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -# Sample workflow for building and deploying a Jekyll site to GitHub Pages -name: Deploy Jekyll site to Pages +name: deploy_site on: - # Runs on pushes targeting the default branch + # runs on pushes targeting the default branch push: branches: ["master"] - # Allows you to run this workflow manually from the Actions tab + # allows to run this workflow manually from the actions tab workflow_dispatch: -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +# set permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: contents: read pages: write id-token: write -# Allow one concurrent deployment +# allow one concurrent deployment concurrency: group: "pages" cancel-in-progress: true jobs: - # Build job build: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v3 - - name: Setup Ruby - uses: ruby/setup-ruby@v1 - with: - # runs-on: ubuntu-22.04 - ruby-version: '3.1' # Not needed with a .ruby-version file - bundler-cache: true # runs 'bundle install' and caches installed gems automatically - cache-version: 0 # Increment this number if you need to re-download cached gems - - name: Setup Pages - id: pages - uses: actions/configure-pages@v2 + - name: Install Ruby + run: | + sudo apt update -y && sudo apt install -y ruby-full bundler + - name: Install Ruby libraries + run: | + bundle config set --local path vendor + bundle install - name: Build with Jekyll - # Outputs to the './_site' directory by default - run: bundle exec jekyll build --baseurl "${{steps.pages.outputs.base_path}}" + # outputs to './_site' by default + run: | + bundle exec jekyll build --baseurl "${{steps.pages.outputs.base_path}}" env: JEKYLL_ENV: production - name: Upload artifact - # Automatically uploads an artifact from the './_site' directory by default uses: actions/upload-pages-artifact@v3 + with: + path: ./_site + name: github-pages - # Deployment job deploy: environment: name: github-pages @@ -62,4 +54,4 @@ jobs: steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v1 + uses: actions/deploy-pages@v4