Skip to content

Commit

Permalink
Merge pull request #1 from UoA-eResearch/gh-pages
Browse files Browse the repository at this point in the history
add workflows
  • Loading branch information
JLoveUOA authored Sep 25, 2024
2 parents 5e12ed1 + b99ef56 commit fc7ef82
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 1 deletion.
71 changes: 71 additions & 0 deletions .github/workflows/jekyll.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Jekyll site CI

on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.branch }}

- name: Setup Ruby
uses: ruby/[email protected]
with:
ruby-version: '3.1'
bundler-cache: true
cache-version: 0

- name: Setup Pages
id: pages
uses: actions/configure-pages@v2

- name: Install dependencies
run: |
bundle install
- name: Build with Jekyll
# Outputs to the './_site' directory by default
run: |
bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
env:
PAGES_REPO_NWO: ${{ github.repository }}
JEKYLL_ENV: production
JEKYLL_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JEKYLL_BUILD_BRANCH: ${{ github.ref_name }}
JEKYLL_BASE_PATH: ${{ steps.pages.outputs.base_path }}

- name: Upload artifact
uses: actions/upload-pages-artifact@v1

deploy:
runs-on: ubuntu-latest
needs: build

if: |
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'push' && github.event.repository.default_branch == github.ref_name)
concurrency:
group: "pages"
cancel-in-progress: true

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
4 changes: 3 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ source "https://rubygems.org"
# Happy Jekylling!
gem "jekyll", "~> 3.10.0"
# This is the default theme for new Jekyll sites. You may change this to anything you like.
gem "minima", "~> 2.5"
# gem "minima", "~> 2.5"
gem "elixir-toolkit-theme", "~> 3.0.1"

# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
gem "github-pages", "~> 232", group: :jekyll_plugins
Expand Down

0 comments on commit fc7ef82

Please sign in to comment.