Try to fix deployment issue #830
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-latest | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v2 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
- name: Install ImageMagick and dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y imagemagick libmagickwand-dev libmagickcore-dev pkg-config | |
# Set the PKG_CONFIG_PATH to help rmagick find the MagickCore library | |
- name: Set PKG_CONFIG_PATH for rmagick | |
run: echo "PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig" >> $GITHUB_ENV | |
- 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/ |