Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jekyll build/deploy workflow #86

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open
70 changes: 55 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,55 @@
# name: Jekyll deploy

# on: [push]

# jobs:
# build_and_deploy:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v1
# - name: Build & Deploy to GitHub Pages
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# GITHUB_REPOSITORY: ${{ secrets.GITHUB_REPOSITORY }}
# GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
# uses: BryanSchuetz/jekyll-deploy-gh-pages@master
# References
# https://github.com/limjh16/jekyll-action-ts/blob/master/.github/workflows/workflow.yml

name: Build and deploy Jekyll site

on:
workflow_dispatch:
push:
branches:
- master
- jekyll-build-deploy-workflow
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be removed before this PR is merged, and/or a better solution for testing in non-master PR's implemented (that won't override our production site deployment)

paths-ignore:
- .cache/**
# - .github/**
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uncomment this?

- _drafts/**
- _draftsOldTumblr/**
- _writing/**
- README.md
- PUBLISHING.md

jobs:
jekyll:
runs-on: ubuntu-latest
steps:
- name: 📂 checkout
uses: actions/checkout@v2

- name: 💎 setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: .ruby-version

- name: 🔨 install system dependencies
run: sudo apt-get install libgsl-dev
Comment on lines +33 to +34
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can be cleaned up as part of #87

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we even want to clean it up anymore.. see #87 and #83 for more context/details.


- name: 🔨 install dependencies & build site
uses: limjh16/jekyll-action-ts@v2
with:
enable_cache: true
# format_output: true
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to enable this? Otherwise, remove it.

custom_opts: '--lsi --profile'
env:
JEKYLL_GITHUB_TOKEN: ${{ secrets.JEKYLL_GITHUB_TOKEN_PAT }}

- id: currentdate
name: 📅 get current date and time
run: echo "::set-output name=date_str::$(date)"

- name: 🚀 deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./_site
publish_branch: jekyll-build-deploy-workflow-gh-pages
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be changed to the proper gh-pages branch before this PR is merged, and/or a better solution for testing in non-master PR's implemented (that won't override our production site deployment)

commit_message: "Update site: ${{ steps.currentdate.outputs.date_str }}"