2023-10-23 13:36:59 +02:00
|
|
|
# Sample workflow for building and deploying a Jekyll site to GitHub Pages
|
2023-10-27 13:45:31 +02:00
|
|
|
name: Deploy Jekyll with GitHub Pages dependencies preinstalled
|
2023-10-23 13:36:59 +02:00
|
|
|
|
|
|
|
on:
|
|
|
|
# Runs on pushes targeting the default branch
|
|
|
|
push:
|
|
|
|
branches: ["main"]
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
|
|
# 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:
|
2024-03-27 01:17:45 +01:00
|
|
|
name: "Build GitHub Pages Site"
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2023-10-23 13:36:59 +02:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-10-25 00:13:07 +02:00
|
|
|
- name: Cached checkout
|
|
|
|
uses: nschloe/action-cached-lfs-checkout@v1
|
|
|
|
# Use these to explicitly include/exclude files:
|
|
|
|
# with:
|
|
|
|
# include: "*"
|
|
|
|
# exclude: ""
|
2024-03-27 01:17:45 +01:00
|
|
|
|
|
|
|
- name: "Setup Ruby"
|
|
|
|
uses: ruby/setup-ruby@v1
|
2023-10-27 13:45:31 +02:00
|
|
|
with:
|
2024-03-27 01:17:45 +01:00
|
|
|
bundler-cache: true
|
|
|
|
cache-version: 0 # Increment this number if you need to re-download cached gems.
|
|
|
|
|
|
|
|
- name: "Setup Pages"
|
|
|
|
id: pages
|
|
|
|
uses: actions/configure-pages@v4
|
|
|
|
|
|
|
|
- name: "Build with Jekyll"
|
|
|
|
run: bundle exec jekyll build --trace --baseurl "${{ steps.pages.outputs.base_path }}"
|
|
|
|
env:
|
|
|
|
JEKYLL_ENV: production
|
|
|
|
|
|
|
|
- name: "Upload artifact"
|
2024-03-27 00:22:26 +01:00
|
|
|
uses: actions/upload-pages-artifact@v3
|
2024-03-27 01:17:45 +01:00
|
|
|
with:
|
|
|
|
path: _site/
|
2023-10-23 13:36:59 +02:00
|
|
|
|
|
|
|
# Deployment job
|
2024-03-27 01:17:45 +01:00
|
|
|
|
2023-10-23 13:36:59 +02:00
|
|
|
deploy:
|
2024-03-27 01:17:45 +01:00
|
|
|
name: "Deploy GitHub Pages Site"
|
|
|
|
if: github.event_name == 'push'
|
|
|
|
needs:
|
|
|
|
- build
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
pages: write
|
|
|
|
id-token: write
|
|
|
|
|
2023-10-23 13:36:59 +02:00
|
|
|
environment:
|
|
|
|
name: github-pages
|
|
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
2024-03-27 01:17:45 +01:00
|
|
|
|
2023-10-23 13:36:59 +02:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2024-03-27 01:17:45 +01:00
|
|
|
- name: "Deploy to GitHub Pages"
|
2023-10-23 13:36:59 +02:00
|
|
|
id: deployment
|
2024-03-27 00:22:26 +01:00
|
|
|
uses: actions/deploy-pages@v4
|
2024-03-27 01:17:45 +01:00
|
|
|
with:
|
|
|
|
error_count: 0
|