-
-
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.
- Loading branch information
1 parent
2efdbcf
commit edee4a9
Showing
2 changed files
with
91 additions
and
34 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,95 @@ | ||
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: | ||
runs-on: ubuntu-22.04 | ||
# 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.2.2" | ||
bundler-cache: true | ||
- 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: | | ||
pip3 install --upgrade jupyter | ||
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,29 @@ | ||
source 'https://rubygems.org' | ||
group :jekyll_plugins do | ||
gem 'classifier-reborn' | ||
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' | ||
end | ||
group :other_plugins do | ||
gem 'httparty' | ||
gem 'css_parser' | ||
gem 'feedjira' | ||
end | ||
gem 'httparty' | ||
end |