build and deploy #832
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: build and deploy | |
on: | |
schedule: | |
- cron: '0 6 * * *' | |
push: | |
branches: | |
- '*' | |
tags-ignore: | |
- '*' | |
pull_request: | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Configure git | |
run: | | |
git config user.name github-actions | |
git config user.email [email protected] | |
git branch --track gh-pages origin/gh-pages | |
- name: Setup Perl | |
uses: shogo82148/actions-setup-perl@v1 | |
- name: Setup Perl environment | |
run: | | |
echo PERL5LIB="$(pwd)/local/lib/perl5:${PERL5LIB}" >> $GITHUB_ENV | |
echo PERL_VERSION="$(perl -E 'print $^V')" >> $GITHUB_ENV | |
echo "$(pwd)/local/bin" >> $GITHUB_PATH | |
- name: Cache dependencies | |
uses: actions/cache@v3 | |
with: | |
path: local | |
key: ${{ runner.os }}-cache-deps-${{ env.PERL_VERSION }}-{{ hashFiles('cpanfile') }} | |
- name: Log perl version | |
run: perl -V | |
- name: Install dependencies | |
run: cpm install | |
- name: Build site | |
run: statocles --lib build | |
if: github.ref != 'refs/heads/master' | |
- name: Deploy to GitHub Pages | |
run: statocles --lib deploy | |
if: github.ref == 'refs/heads/master' |