Skip to content

Commit ecd0421

Browse files
committed
Deploy using jekyll template workflow with github actions
1 parent 0c5efb4 commit ecd0421

File tree

2 files changed

+70
-1
lines changed

2 files changed

+70
-1
lines changed

.github/workflows/jekyll.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# This is the template Jekyll workflow generated on selection of the "Github Actions" option under [repo settings] > Pages > Build and deployment > Source
2+
3+
# ---------------------------------------
4+
5+
# This workflow uses actions that are not certified by GitHub.
6+
# They are provided by a third-party and are governed by
7+
# separate terms of service, privacy policy, and support
8+
# documentation.
9+
10+
# Sample workflow for building and deploying a Jekyll site to GitHub Pages
11+
name: Deploy Jekyll site to Pages
12+
13+
on:
14+
# Runs on pushes targeting the default branch
15+
push:
16+
branches: ["main"]
17+
18+
# Allows you to run this workflow manually from the Actions tab
19+
workflow_dispatch:
20+
21+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
22+
permissions:
23+
contents: read
24+
pages: write
25+
id-token: write
26+
27+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
28+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
29+
concurrency:
30+
group: "pages"
31+
cancel-in-progress: false
32+
33+
jobs:
34+
# Build job
35+
build:
36+
runs-on: ubuntu-latest
37+
steps:
38+
- name: Checkout
39+
uses: actions/checkout@v4
40+
- name: Setup Ruby
41+
# https://github.com/ruby/setup-ruby/releases/tag/v1.207.0
42+
uses: ruby/setup-ruby@4a9ddd6f338a97768b8006bf671dfbad383215f4
43+
with:
44+
ruby-version: '3.4.1' # Sync with Gemfile
45+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
46+
cache-version: 0 # Increment this number if you need to re-download cached gems
47+
- name: Setup Pages
48+
id: pages
49+
uses: actions/configure-pages@v5
50+
- name: Build with Jekyll
51+
# Outputs to the './_site' directory by default
52+
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
53+
env:
54+
JEKYLL_ENV: production
55+
- name: Upload artifact
56+
# Automatically uploads an artifact from the './_site' directory by default
57+
uses: actions/upload-pages-artifact@v3
58+
59+
# Deployment job
60+
deploy:
61+
environment:
62+
name: github-pages
63+
url: ${{ steps.deployment.outputs.page_url }}
64+
runs-on: ubuntu-latest
65+
needs: build
66+
steps:
67+
- name: Deploy to GitHub Pages
68+
id: deployment
69+
uses: actions/deploy-pages@v4

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ruby "3.4.1"
1+
ruby "3.4.1" # Sync with jekyll.yml workflow
22
source "https://rubygems.org"
33

44
gem "jekyll", "~> 4.4.1"

0 commit comments

Comments
 (0)