From 808ebd6051de51b909c8394e6806cc1ceb580315 Mon Sep 17 00:00:00 2001 From: musicEnfanthen Date: Sat, 1 Feb 2025 22:49:22 +0100 Subject: [PATCH] ci: update jekyll build workflow --- .github/workflows/jekyll.yml | 54 ++++++++++++++++++++++++++---------- 1 file changed, 40 insertions(+), 14 deletions(-) diff --git a/.github/workflows/jekyll.yml b/.github/workflows/jekyll.yml index c0ade92c..4effe90d 100644 --- a/.github/workflows/jekyll.yml +++ b/.github/workflows/jekyll.yml @@ -11,23 +11,49 @@ jobs: build_jekyll: runs-on: ubuntu-latest if: github.repository_owner == 'music-encoding' - - permissions: - contents: write steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - # Use GitHub Actions' cache to shorten build times and decrease load on servers - - uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 + - name: Setup Ruby + uses: ruby/setup-ruby@2654679fe7f7c29875c669398a8ec0791b8a64a1 # v1.215.0 with: - path: vendor/bundle - key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile') }} - restore-keys: | - ${{ runner.os }}-gems- + 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@983d7736d9b0ae728b81ab479565c72886d7745b #v5.0.0 - # Build Jekyll to the specified target branch - - uses: helaili/jekyll-action@c1527523361ec3ecc54b2371ddef44826e28c0f5 # v2.5.0 - with: - token: ${{ secrets.GITHUB_TOKEN }} - target_branch: 'gh-pages' \ No newline at end of file + - name: Build with Jekyll + # Outputs to the './_site' directory 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@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1 + + + deploy: + runs-on: ubuntu-latest + if: github.repository_owner == 'music-encoding' + + needs: build_jekyll + + # Grant GITHUB_TOKEN the permissions required to make a Pages deployment + permissions: + pages: write # to deploy to Pages + id-token: write # to verify the deployment originates from an appropriate source + + # Setup the github-pages environment + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5