Release 4.3 #302
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: Jekyll deployment | |
# Builds the site and pushes the _site/ output to gh-pages | |
on: | |
push: | |
branches: [ master ] | |
env: | |
GEMS_CACHE_ID: 1 | |
jobs: | |
build: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
- name: "Checks-out the repository" | |
uses: actions/checkout@v3.0.2 | |
with: | |
set-safe-directory: true | |
- name: "Change config to generate full-chapter pages" | |
run: | | |
sed -i 's/generate-full-chapters: false/generate-full-chapters: true/g' _config.yml | |
- name: "Install the Leipzig font" | |
run: | | |
cd scripts | |
wget https://raw.githubusercontent.com/rism-digital/verovio/master/fonts/Leipzig/Leipzig.ttf | |
sudo cp ./Leipzig.ttf /usr/local/share/fonts | |
sudo cp ./Leipzig.ttf /usr/share/fonts | |
sudo fc-cache -f -v | |
- name: "Install wkhtmltopdf" | |
run: | | |
wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb | |
sudo apt install ./wkhtmltox_0.12.6-1.focal_amd64.deb | |
- name: "Install ruby" | |
uses: actions/setup-ruby@v1 | |
with: | |
ruby-version: '3.1' | |
- name: "Install gems with cache" | |
uses: actions/cache@v3.0.8 | |
with: | |
path: vendor/bundle | |
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}-${{ env.GEMS_CACHE_ID }} | |
- name: "Build the book, run a server locally and generate the PDF" | |
run: | | |
bundle config path vendor/bundle | |
bundle install | |
bundle exec jekyll build | |
cd _site | |
gem install webrick | |
ruby -run -ehttpd . -p4000 & | |
sleep 10 | |
cd .. | |
./scripts/generate-pdf.sh | |
sudo cp scripts/verovio-reference-book.pdf _site/ | |
sudo rm -rf _site/pdf | |
# Deploy _site to the gh-pages branch | |
- name: Deploy | |
uses: s0/git-publish-subdir-action@develop | |
env: | |
REPO: self | |
BRANCH: gh-pages | |
FOLDER: _site | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |