Skip to content

Build

Build #1626

Workflow file for this run

name: Build
on:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '30 0 * * *'
push:
branches:
- '**' # matches all branches
- '!gh-pages' # excludes master
jobs:
build-and-deploy:
name: Build and deploy (py-${{ matrix.python_version }}, ruby-${{ matrix.ruby_version }})
runs-on: ubuntu-latest
strategy:
matrix:
ruby_version: ['3.1']
python_version: ['3.10']
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2 # If you're using actions/checkout@v2 you must set persist-credentials to false in most cases for the deployment to work correctly.
with:
submodules: 'recursive'
persist-credentials: false
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python_version }}
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
bundler-cache: true
- name: Install poetry & create virtualenv
shell: bash
run: |
pip install poetry 'urllib3<2'
python -m venv venv
- name: Install dependencies
run: |
sudo npm install --global pug pug-cli
make install-deps
- name: Get latest releases
run: |
source venv/bin/activate || source venv/Scripts/activate
pip install -r requirements.txt
make update-downloads
- name: Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built.
run: |
source venv/bin/activate || source venv/Scripts/activate
make build
touch _site/.nojekyll
# Might not work due to GitHub being weird about not triggering site rebuilds from workflows.
# See this for more info: https://github.community/t5/GitHub-Actions/Github-action-not-triggering-gh-pages-upon-push/td-p/26869/highlight/true/page/3
- name: Deploy 🚀
uses: JamesIves/[email protected]
if: github.ref == 'refs/heads/master'
with:
branch: gh-pages # The branch the action should deploy to.
folder: _site # The folder the action should deploy.
git-config-name: GitHub Actions
git-config-email: [email protected]
# Needed to prevent GitHub from disabling the cronjob after 60 days of repo inactivity
# https://dev.to/gautamkrishnar/how-to-prevent-github-from-suspending-your-cronjob-based-triggers-knf
- uses: gautamkrishnar/keepalive-workflow@master # using the workflow with default settings