web/.github/workflows/pages-deploy.yml.hook

54 lines
1.1 KiB
Text
Raw Normal View History

2020-07-28 21:27:40 +03:00
name: 'Automatic build'
on:
push:
branches:
- master
paths-ignore:
2020-10-03 11:45:17 +03:00
- .gitignore
- README.md
- LICENSE
2020-07-28 21:27:40 +03:00
jobs:
continuous-delivery:
2020-07-28 21:27:40 +03:00
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
2020-07-28 21:27:40 +03:00
- name: Check baseurl
2020-07-28 21:27:40 +03:00
run: |
2020-11-19 15:39:02 +03:00
baseurl="$(grep '^baseurl:' _config.yml | sed "s/.*: *//;s/['\"]//g;s/#.*//")"
if [[ -n $baseurl ]]; then
echo "BASE_URL=$baseurl" >> $GITHUB_ENV
fi
2020-07-28 21:27:40 +03:00
- name: Build Site
env:
JEKYLL_ENV: production
2020-07-28 21:27:40 +03:00
run: |
bundle exec jekyll b -d "_site$BASE_URL"
2020-07-28 21:27:40 +03:00
- name: Test Site
2020-07-28 21:27:40 +03:00
run: |
bash tools/test.sh
2020-07-28 21:27:40 +03:00
- name: Deploy
run: |
if [[ -n $BASE_URL ]]; then
mv _site$BASE_URL _site-rename
rm -rf _site
mv _site-rename _site
fi
2020-07-28 21:27:40 +03:00
bash tools/deploy.sh