Skip to content

Commit

Permalink
ci: update jekyll build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
musicEnfanthen committed Feb 1, 2025
1 parent f890610 commit 808ebd6
Showing 1 changed file with 40 additions and 14 deletions.
54 changes: 40 additions & 14 deletions .github/workflows/jekyll.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
- 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

0 comments on commit 808ebd6

Please sign in to comment.