SO fix #835
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
name: Deploy | |
on: | |
push: | |
branches: | |
- master | |
env: | |
RUBY_VERSION: 3.0.1 | |
jobs: | |
deploy: | |
name: gh-pages | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v2 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
- name: Building site | |
run: JEKYLL_ENV=production bundle exec jekyll build --profile --trace | |
env: | |
GISCUS_DATA_REPO_ID: ${{ secrets.GISCUS_DATA_REPO_ID }} | |
GISCUS_GISCUS_DATA_CATEGORY_ID: ${{ secrets.GISCUS_DATA_REPO_ID }} | |
YOUTUBE_API_TOKEN: ${{ secrets.YOUTUBE_API_TOKEN }} | |
GMAIL: ${{ secrets.CESAR_PERSONAL_GMAIL }} | |
- name: Cache Jekyll _site directory | |
uses: actions/cache@v3 | |
with: | |
path: _site | |
key: ${{ runner.os }}-jekyll-${{ hashFiles('**/Gemfile.lock') }} | |
restore-keys: | | |
${{ runner.os }}-jekyll- | |
- name: Install Minify deb package on Ubuntu | |
run: sudo apt-get update && sudo apt-get install --no-install-recommends --yes minify | |
- name: Minify HTML files | |
run: | | |
minify --type=html --recursive --output "./" --match=\.html "./_site/" \ | |
--html-keep-conditional-comments \ | |
--html-keep-default-attrvals \ | |
--html-keep-document-tags \ | |
--html-keep-end-tags \ | |
--verbose | |
- name: Minify JSON files | |
run: | | |
minify --type=json --recursive --output "./" --match=\.json "./_site/" --verbose || true | |
- name: Minify JavaScript files | |
run: | | |
minify --mime=application/javascript --recursive --output "./" --match=\.js "./_site/js" --verbose || true | |
- name: Minify CSS files | |
run: | | |
minify --type=css --recursive --output "./" --match=\.css "./_site/css" --verbose || true | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
if: success() | |
with: | |
allow_empty_commit: false | |
cname: www.cesarsotovalero.net | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_branch: gh-pages | |
publish_dir: ./_site/ |