-
Notifications
You must be signed in to change notification settings - Fork 71
Update to gh actions page build #446
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
Changes from all commits
990b360
b7c7a1e
346e659
a8996e4
f0bd453
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# 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 | ||
|
||
on: | ||
# Runs on pushes targeting the default branch | ||
push: | ||
branches: [$default-branch] | ||
|
||
# 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-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
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 | ||
- name: Setup Pages | ||
id: pages | ||
uses: actions/configure-pages@v5 | ||
- name: Build with Jekyll | ||
# Outputs to the './_site' directory by default | ||
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}" | ||
env: | ||
JEKYLL_ENV: production | ||
- name: Upload artifact | ||
# Automatically uploads an artifact from the './_site' directory by default | ||
uses: actions/upload-pages-artifact@v3 | ||
|
||
# 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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,4 @@ all_contribs.pickle | |
.vale.ini | ||
styles/* | ||
tmp/* | ||
.bundle |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.3.3 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I also didn't know you could pin the ruby version. gosh learning so much. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,17 @@ | ||
source "https://rubygems.org" | ||
|
||
gem "github-pages", group: :jekyll_plugins | ||
gem "jekyll-include-cache" | ||
gem "webrick" | ||
gem "html-proofer" | ||
gem "ffi", "= 1.16.3" | ||
|
||
gem "jekyll", "~>4.3.3" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @sneakers-the-rat i am going to merge this but i have a question. You may have said this in the pr header but i want to be clear about what this does! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep! We can add whatever gems we want here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yay!! |
||
|
||
group :jekyll_plugins do | ||
gem "jekyll-paginate", "~> 1.1" | ||
gem "jekyll-sitemap", "~> 1.4" | ||
gem "jekyll-gist", "~> 1.5" | ||
gem "jekyll-feed", "~> 0.17.0" | ||
gem "jemoji", "~> 0.13.0" | ||
gem "jekyll-redirect-from", "~> 0.16.0" | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -217,6 +217,7 @@ kramdown: | |
sass: | ||
sass_dir: _sass | ||
style: compressed # http://sass-lang.com/documentation/file.SASS_REFERENCE.html#output_style | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Gosh does this automagically minify the css?! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. as much as css can be minified! (it doesn't eg. simplify rules afaik, and you can't do the javascript thing of replacing all names with single characters, yes it does remove as much as it can https://sass-lang.com/documentation/cli/dart-sass/#style ) |
||
quiet_deps: true | ||
|
||
# Outputting | ||
permalink: /:categories/:title/ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sneakers-the-rat i didn't know there was a $default-branch variable for actions. gosh that would have saved me a lot of time when we did the updates master --> main branch forever ago.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait actually idk if this works lmao I think that might need to be a literal, but the sample action had this in it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😆 so i'm not sure it does?? https://github.com/pyOpenSci/pyopensci.github.io/actions/workflows/gh-pages.yml
when i look at that this build after directly commiting a small change to main 🙈 it wasn't triggered

but what did get triggered is this action
could that be because i have github pages "turned on " in the repo settings somewhere? it's odd because the "pages" tab says this:

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh yes - sorry, so yeah that should be replaced by
main
, and then you go to the pages setting and switch it from "deploy from branch" to "github action" . we just did this switch for our lab website and after that it worked without fuss