-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update deploy workflow and pull from alshedivat/al-folio
- Loading branch information
1 parent
05d7587
commit dc75551
Showing
5 changed files
with
123 additions
and
43 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,101 @@ | ||
name: deploy | ||
name: Deploy site | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
paths: | ||
- "assets/**" | ||
- "**.bib" | ||
- "**.html" | ||
- "**.js" | ||
- "**.liquid" | ||
- "**/*.md" | ||
- "**.yml" | ||
- "Gemfile" | ||
- "Gemfile.lock" | ||
- "!.github/workflows/axe.yml" | ||
- "!.github/workflows/broken-links.yml" | ||
- "!.github/workflows/deploy-docker-tag.yml" | ||
- "!.github/workflows/deploy-image.yml" | ||
- "!.github/workflows/docker-slim.yml" | ||
- "!.github/workflows/lighthouse-badger.yml" | ||
- "!.github/workflows/prettier.yml" | ||
- "!lighthouse_results/**" | ||
- "!CONTRIBUTING.md" | ||
- "!CUSTOMIZE.md" | ||
- "!FAQ.md" | ||
- "!INSTALL.md" | ||
- "!README.md" | ||
pull_request: | ||
branches: | ||
- master | ||
- main | ||
paths: | ||
- "assets/**" | ||
- "**.bib" | ||
- "**.html" | ||
- "**.js" | ||
- "**.liquid" | ||
- "**/*.md" | ||
- "**.yml" | ||
- "Gemfile" | ||
- "Gemfile.lock" | ||
- "!.github/workflows/axe.yml" | ||
- "!.github/workflows/broken-links.yml" | ||
- "!.github/workflows/deploy-docker-tag.yml" | ||
- "!.github/workflows/deploy-image.yml" | ||
- "!.github/workflows/docker-slim.yml" | ||
- "!.github/workflows/lighthouse-badger.yml" | ||
- "!.github/workflows/prettier.yml" | ||
- "!lighthouse_results/**" | ||
- "!CONTRIBUTING.md" | ||
- "!CUSTOMIZE.md" | ||
- "!FAQ.md" | ||
- "!INSTALL.md" | ||
- "!README.md" | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
deploy: | ||
# available images: https://github.com/actions/runner-images#available-images | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Setup Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: '3.0.2' | ||
bundler-cache: true | ||
- name: Install deps | ||
run: | | ||
npm install -g mermaid.cli | ||
- name: Setup deploy options | ||
id: setup | ||
run: | | ||
git config --global user.name "GitHub Action" | ||
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
if [[ ${GITHUB_REF} = refs/pull/*/merge ]]; then # pull request | ||
echo "::set-output name=SRC_BRANCH::${GITHUB_HEAD_REF}" | ||
echo "::set-output name=NO_PUSH::--no-push" | ||
elif [[ ${GITHUB_REF} = refs/heads/* ]]; then # branch, e.g. master, source etc | ||
echo "::set-output name=SRC_BRANCH::${GITHUB_REF#refs/heads/}" | ||
fi | ||
echo "::set-output name=DEPLOY_BRANCH::gh-pages" | ||
- name: Deploy website | ||
run: yes | bash bin/deploy --verbose ${{ steps.setup.outputs.NO_PUSH }} | ||
--src ${{ steps.setup.outputs.SRC_BRANCH }} | ||
--deploy ${{ steps.setup.outputs.DEPLOY_BRANCH }} | ||
- name: Checkout 🛎️ | ||
uses: actions/checkout@v4 | ||
- name: Setup Ruby 💎 | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: "3.3.5" | ||
bundler-cache: true | ||
- name: Setup Python 🐍 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.13" | ||
cache: "pip" # caching pip dependencies | ||
- name: Update _config.yml ⚙️ | ||
uses: fjogeleit/yaml-update-action@main | ||
with: | ||
commitChange: false | ||
valueFile: "_config.yml" | ||
propertyPath: "giscus.repo" | ||
value: ${{ github.repository }} | ||
- name: Install and Build 🔧 | ||
run: | | ||
sudo apt-get update && sudo apt-get install -y imagemagick | ||
pip3 install --upgrade nbconvert | ||
export JEKYLL_ENV=production | ||
bundle exec jekyll build | ||
- name: Purge unused CSS 🧹 | ||
run: | | ||
npm install -g purgecss | ||
purgecss -c purgecss.config.js | ||
- name: Deploy 🚀 | ||
if: github.event_name != 'pull_request' | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
folder: _site |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,36 @@ | ||
source 'https://rubygems.org' | ||
|
||
gem 'jekyll' | ||
|
||
# Core plugins that directly affect site building | ||
group :jekyll_plugins do | ||
gem 'jekyll' | ||
gem 'jekyll-archives' | ||
gem 'jekyll-diagrams' | ||
gem 'jekyll-email-protect' | ||
gem 'jekyll-feed' | ||
gem 'jekyll-get-json' | ||
gem 'jekyll-imagemagick' | ||
gem 'jekyll-jupyter-notebook' | ||
gem 'jekyll-link-attributes' | ||
gem 'jekyll-minifier' | ||
gem 'jekyll-paginate-v2' | ||
gem 'jekyll-regex-replace' | ||
gem 'jekyll-scholar' | ||
gem 'jekyll-sitemap' | ||
gem 'jekyll-target-blank' | ||
gem 'jekyll-tabs' | ||
gem 'jekyll-toc' | ||
gem 'jekyll-twitter-plugin' | ||
gem 'jekyll-redirect-from' | ||
gem 'jemoji' | ||
gem 'mini_racer' | ||
gem 'unicode_utils' | ||
gem 'webrick' | ||
gem 'jekyll-loading-lazy' | ||
|
||
gem 'classifier-reborn' # used for content categorization during the build | ||
end | ||
|
||
# Gems for development or external data fetching (outside :jekyll_plugins) | ||
group :other_plugins do | ||
gem 'httparty' | ||
gem 'css_parser' | ||
gem 'feedjira' | ||
gem 'httparty' | ||
gem 'observer' # used by jekyll-scholar | ||
gem 'ostruct' # used by jekyll-twitter-plugin | ||
# gem 'unicode_utils' -- should be already installed by jekyll | ||
# gem 'webrick' -- should be already installed by jekyll | ||
end |
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = { | ||
content: ["_site/**/*.html", "_site/**/*.js"], | ||
css: ["_site/assets/css/*.css"], | ||
output: "_site/assets/css/", | ||
skippedContentGlobs: ["_site/assets/**/*.html"], | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
nbconvert |