-
-
Notifications
You must be signed in to change notification settings - Fork 1
82 lines (67 loc) · 2.51 KB
/
workflow.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
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/