Compile HTML and Deploy to GitHub Pages #865
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: Compile HTML and Deploy to GitHub Pages | |
on: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
github-pages: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v2 | |
- name: Install Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.0.1 | |
bundler-cache: true | |
- name: Compile HTML | |
run: bundle exec jekyll build | |
shell: bash | |
- name: Deploy to GitHub Pages | |
run: | | |
cd _site | |
touch .nojekyll | |
git config --global init.defaultBranch main | |
git config --global user.name "vivarium-collective" | |
git config --global user.email "[email protected]" | |
git init | |
git add -A | |
git commit -m "Jekyll build from commit $GITHUB_SHA by GitHub Action" | |
git push -f "https://$GITHUB_ACTOR:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY.git" main:gh-pages |