vault backup: 2024-08-13 21:26:58 #201
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: "Automatic build" | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- .gitignore | |
- README.md | |
- LICENSE | |
jobs: | |
continuous-delivery: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 # for posts's lastmod | |
- name: Setup Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 2.7 | |
bundler-cache: true | |
- name: Check baseurl | |
run: | | |
baseurl="$(grep '^baseurl:' _config.yml | sed "s/.*: *//;s/['\"]//g;s/#.*//")" | |
if [[ -n $baseurl ]]; then | |
echo "BASE_URL=$baseurl" >> $GITHUB_ENV | |
fi | |
- name: Build Site | |
env: | |
JEKYLL_ENV: production | |
run: | | |
bundle exec jekyll b -d "_site$BASE_URL" | |
- name: Deploy | |
run: | | |
if [[ -n $BASE_URL ]]; then | |
mv _site$BASE_URL _site-rename | |
rm -rf _site | |
mv _site-rename _site | |
fi | |
bash tools/deploy.sh |