Skip to content

Deploy Jekyll site to Pages #66

Deploy Jekyll site to Pages

Deploy Jekyll site to Pages #66

name: Deploy Jekyll site to Pages
# Starting point: https://github.com/actions/starter-workflows/blob/main/pages/jekyll.yml
on:
push:
branches: ["staging"]
# 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 job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Set up Ruby and install gems
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.4'
bundler-cache: true
working-directory: ./docs
cache-version: 0 # Increment this number if you need to re-download cached gems
- name: Setup Pages
id: pages
uses: actions/configure-pages@v6
- name: Write secondary config if available
run: |
echo "${{ vars.JEKYLL_SITE_CONFIG }}" > _site_config.yml
echo "SITE_CONFIG=_site_config.yml" >> "$GITHUB_ENV"
if: ${{ vars.JEKYLL_SITE_CONFIG != '' }}
working-directory: ./docs
- name: Build with Jekyll
run: bundle exec jekyll build --config _config.yml,$SITE_CONFIG --baseurl "${{ steps.pages.outputs.base_path }}"
working-directory: ./docs
env:
JEKYLL_ENV: production
PAGES_REPO_NWO: "${{ github.repository }}"
- name: Run Lychee
uses: lycheeverse/lychee-action@v2
with:
# --remap matches the fully-resolved file URI (not the raw href), so the pattern
# must include the file:// scheme and --root-dir prefix. The (/|$) tail handles
# both `/twinBASIC-docs/page` and bare `/twinBASIC-docs` — lychee strips trailing
# slashes before remap, so we can't require one in the pattern.
args: >-
--offline --include-fragments
--fallback-extensions html
--index-files 'index.html,.'
--remap '^file://${{ github.workspace }}/docs/_site${{ steps.pages.outputs.base_path }}(/|$) file://${{ github.workspace }}/docs/_site/'
--root-dir ${{ github.workspace }}/docs/_site
./_site
workingDirectory: ./docs
fail: true
- name: Upload artifact
uses: actions/upload-pages-artifact@v5
with:
path: ./docs/_site
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5