Skip to content

Commit

Permalink
modernize publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mojavelinux committed Nov 20, 2023
1 parent de91ff4 commit 979723e
Showing 1 changed file with 23 additions and 13 deletions.
36 changes: 23 additions & 13 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,36 @@ on:
concurrency:
group: pages
cancel-in-progress: true
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
jobs:
jekyll:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Use the GitHub Actions cache to shorten build times and decrease load on servers
- uses: actions/cache@v2
- name: Checkout
uses: actions/checkout@v4
- name: Install Ruby and Jekyll
uses: ruby/setup-ruby@v1
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('Gemfile') }}
restore-keys: ${{ runner.os }}-gems-
# Standard usage
- uses: helaili/jekyll-action@v2
ruby-version: '3.2'
bundler-cache: true
#- name: Setup Pages
# uses: actions/configure-pages@v3
- name: Configure Site
run: |
sed -i "s/^#baseurl: .*/baseurl: \/${{ github.event.repository.name }}/" _config.yml
- name: Generate Site
run: bundle exec jekyll build
- name: Upload Artifacts
uses: actions/upload-pages-artifact@v1
with:
pre_build_commands: |
sed -i "s/^#baseurl: .*/baseurl: \/${{ github.event.repository.name }}/" _config.yml
gem update --system
token: ${{ secrets.GITHUB_TOKEN }}
path: _site
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2

0 comments on commit 979723e

Please sign in to comment.