Build static website #11
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 static website | |
on: | |
push: | |
branches: | |
- main | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
cache: 'pip' | |
- name: Download and extract database | |
run: wget -q -O - https://github.com/orgatalk/lanpartydb-data/raw/dist/data.tar.xz | tar xJf - | |
- name: Install dependencies | |
run: pip install -r requirements.lock | |
- name: Generate static website | |
run: flask freeze | |
- name: Configure Git user | |
run: | | |
git config user.name "workflow" | |
git config user.email "workflow@invalid" | |
- name: Create new branch | |
run: git switch --orphan gh-pages | |
- name: Move static website to repository root | |
run: mv -v build/* . | |
- name: Create CNAME file | |
run: echo "lanpartydb.orgatalk.de" > CNAME | |
- name: Add, commit, and push files | |
run: | | |
git add index.html parties/ series/ static/ CNAME | |
git commit -m 'Add static website' | |
git push --force origin gh-pages |