Deploy Jekyll site to Pages for development purpose #125
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
# Sample workflow for building and deploying a Jekyll site to GitHub Pages | |
name: Deploy Jekyll site to Pages for development purpose | |
on: | |
# Runs on pushes targeting the development branch | |
push: | |
branches: ["devel"] | |
# Runs regularly | |
# for requirements regarding schedule see also | |
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule | |
# Notes: | |
# - The schedule event can be delayed during periods of high loads of GitHub Actions | |
# workflow runs. High load times include the start of every hour. If the load is | |
# sufficiently high enough, some queued jobs may be dropped. To decrease the chance | |
# of delay, schedule your workflow to run at a different time of the hour. | |
# - This event will only trigger a workflow run if the workflow file is on the default branch branch. | |
# - Scheduled workflows will only run on the default branch. | |
# - In a public repository, scheduled workflows are automatically disabled when no repository activity has occurred in 60 days. | |
# | |
# UTC does not have winter-/summer time | |
schedule: | |
- cron: '47 9 * * *' | |
# 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-24.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: devel | |
- name: Setup Ruby | |
uses: ruby/[email protected] | |
with: | |
ruby-version: '3.3' # 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 | |
working-directory: "source/" | |
- name: Setup Pages | |
id: pages | |
uses: actions/configure-pages@v4 | |
# see also _config.yml (development_url) | |
- name: Build with Jekyll | |
run: cd "source"; ls -l; bundle exec jekyll build --future --baseurl "${{ steps.pages.outputs.base_path }}" | |
env: | |
JEKYLL_ENV: development | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: 'source/_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@v4 |