Skip to content

Allow using env vars even if not in CI #387

Allow using env vars even if not in CI

Allow using env vars even if not in CI #387

Workflow file for this run

name: build_site
on:
push:
branches:
- "main"
# rebuild once a day at 7:30 UTC
schedule:
- cron: "30 7 * * *"
jobs:
build:
name: Build the website
runs-on: ubuntu-latest
steps:
- name: "Check out the repo"
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: "Install dominant_colours"
run: |
curl -L -O 'https://github.com/alexwlchan/dominant_colours/releases/download/v1.1.8/dominant_colours-x86_64-unknown-linux-gnu.tar.gz'
tar -xzf dominant_colours-x86_64-unknown-linux-gnu.tar.gz
chmod +x dominant_colours
mv dominant_colours /usr/local/bin/dominant_colours
- name: "Check it works"
run: dominant_colours screenshot.png
- name: "Install dependencies"
run: pip3 install -r requirements.txt
- name: "Get the book data"
run: python3 get_book_data.py
env:
LIBRARY_CARD_NUMBER: ${{ secrets.LIBRARY_CARD_NUMBER }}
LIBRARY_CARD_PASSWORD: ${{ secrets.LIBRARY_CARD_PASSWORD }}
- name: "Render the data as HTML"
run: python3 render_data_as_html.py
- name: "Install the Netlify CLI"
run: npm install -g netlify-cli
- name: "Deploy to Netlify"
run: netlify deploy --dir=_html/ --prod
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}