Skip to content

Merge pull request #55 from janosrusiczki/drafts #259

Merge pull request #55 from janosrusiczki/drafts

Merge pull request #55 from janosrusiczki/drafts #259

name: Jekyll Build, Test and Deploy
on:
push:
branches:
- master
jobs:
bundle-build-test:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Set up Ruby, install and cache bundle
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Build site
run: bundle exec jekyll build
- name: Test site
run: bundle exec rake test
- name: Cache site
id: cache-site
uses: actions/cache@v3
with:
path: _site
key: site-sha-${{ github.sha }}
deploy:
runs-on: ubuntu-latest
needs: bundle-build-test
steps:
- name: Restore cache
id: cache-site
uses: actions/cache@v3
with:
path: _site
key: site-sha-${{ github.sha }}
- name: Deploy with rsync
uses: burnett01/rsync-deployments@5.2.1
with:
switches: -avzr --delete
path: _site/
remote_path: ${{ secrets.DEPLOY_PATH }}
remote_host: ${{ secrets.DEPLOY_HOST }}
remote_user: ${{ secrets.DEPLOY_USER }}
remote_key: ${{ secrets.DEPLOY_KEY }}
- name: Delete cache
run: |
curl -s \
-X DELETE \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: Bearer ${{ secrets.PAT_ACTIONS }}" \
https://api.github.com/repos/${{ github.repository }}/actions/caches?key=site-sha-${{ github.sha }}