-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (44 loc) · 1.41 KB
/
build-and-deploy-website.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Build and deploy website
on:
push:
branches:
- main
# Allow 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: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "0.4.27"
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: ".python-version"
- name: Install project
run: uv sync
- name: Download and extract database
run: wget -q -O - https://github.com/orgatalk/lanpartydb-data/raw/dist/data.tar.xz | tar xJf -
- name: Generate static website
run: uv 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