Skip to content

Commit 76146bc

Browse files
committed
init
0 parents  commit 76146bc

1,315 files changed

Lines changed: 15321 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
www
2+
.jj
3+
*.pyc
4+
__pycache__

.gitattributes

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
*.jpg filter=lfs diff=lfs merge=lfs -text
2+
*.jpeg filter=lfs diff=lfs merge=lfs -text
3+
*.png filter=lfs diff=lfs merge=lfs -text
4+
*.webp filter=lfs diff=lfs merge=lfs -text
5+
*.gif filter=lfs diff=lfs merge=lfs -text
6+
*.woff2 filter=lfs diff=lfs merge=lfs -text
7+
*.woff filter=lfs diff=lfs merge=lfs -text
8+
data/screenings.csv filter=lfs diff=lfs merge=lfs -text

.github/workflows/ci.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
jobs:
10+
check:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: jdx/mise-action@v2
15+
- run: mise run lint
16+
- run: mise run format
17+
- run: git diff --exit-code
18+
19+
deploy:
20+
needs: check
21+
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
with:
26+
lfs: true
27+
- uses: superfly/flyctl-actions/setup-flyctl@master
28+
- run: flyctl deploy --remote-only
29+
env:
30+
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

.github/workflows/parse.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Parse
2+
3+
on:
4+
workflow_dispatch: {}
5+
push:
6+
branches: [master]
7+
schedule:
8+
# every day at midnight
9+
- cron: "0 0 * * *"
10+
11+
permissions:
12+
contents: write
13+
pull-requests: write
14+
15+
jobs:
16+
parse:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
token: ${{ secrets.PAT }}
22+
lfs: true
23+
- run: git lfs install
24+
- uses: jdx/mise-action@v2
25+
- run: uv run --group parse playwright install --with-deps chromium
26+
- run: mise run parse
27+
- name: Create PR with changes
28+
env:
29+
GH_TOKEN: ${{ secrets.PAT }}
30+
run: |
31+
BRANCH="parse-${{ github.run_number }}"
32+
if git diff --quiet; then
33+
echo "No changes to commit"
34+
exit 0
35+
fi
36+
git checkout -b "$BRANCH"
37+
git add -A
38+
git -c user.name="github-actions[bot]" -c user.email="41898282+github-actions[bot]@users.noreply.github.com" commit -m "Update screenings"
39+
git push origin "$BRANCH"
40+
PR_URL=$(gh pr create --title "Update screenings" --body "Automated update of screenings data" --base master)
41+
gh pr merge "$PR_URL" --rebase

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
__pycache__/
2+
*.pyc
3+
.venv/
4+
*.lock
5+
build/
6+
!src/build
7+
www/

Dockerfile

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
FROM ghcr.io/astral-sh/uv:python3.13-alpine AS build
2+
WORKDIR /app
3+
RUN apk add --update --no-cache \
4+
libjpeg-turbo-dev libpng-dev libwebp-dev zlib-dev
5+
COPY pyproject.toml uv.lock ./
6+
RUN uv sync --frozen --no-dev --group build
7+
COPY src src
8+
COPY static static
9+
COPY data data
10+
RUN uv run build /app/www
11+
12+
FROM alpine:3.22
13+
ARG S6_OVERLAY_VERSION=3.2.1.0
14+
ADD "https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz" /tmp
15+
ADD "https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-aarch64.tar.xz" /tmp
16+
ADD "https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-x86_64.tar.xz" /tmp
17+
ADD "https://github.com/P3TERX/GeoLite.mmdb/raw/download/GeoLite2-Country.mmdb" /usr/local/share/GeoIP/GeoLite2-Country.mmdb
18+
RUN \
19+
sha256sum "/tmp/s6-overlay-noarch.tar.xz"; \
20+
echo "42e038a9a00fc0fef70bf0bc42f625a9c14f8ecdfe77d4ad93281edf717e10c5 /tmp/s6-overlay-noarch.tar.xz" | sha256sum -c; \
21+
tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz; \
22+
\
23+
case "$(uname -m)" in \
24+
"x86_64") \
25+
sha256sum "/tmp/s6-overlay-x86_64.tar.xz"; \
26+
echo "8bcbc2cada58426f976b159dcc4e06cbb1454d5f39252b3bb0c778ccf71c9435 /tmp/s6-overlay-x86_64.tar.xz" | sha256sum -c; \
27+
tar -C / -Jxpf /tmp/s6-overlay-x86_64.tar.xz; \
28+
;; \
29+
"aarch64") \
30+
sha256sum "/tmp/s6-overlay-aarch64.tar.xz"; \
31+
echo "c8fd6b1f0380d399422fc986a1e6799f6a287e2cfa24813ad0b6a4fb4fa755cc /tmp/s6-overlay-aarch64.tar.xz" | sha256sum -c; \
32+
tar -C / -Jxpf /tmp/s6-overlay-aarch64.tar.xz; \
33+
;; \
34+
*) \
35+
echo "Cannot build, missing valid build platform." \
36+
exit 1; \
37+
esac; \
38+
rm -rf "/tmp/*"; \
39+
apk add --update --no-cache goaccess nginx
40+
COPY --from=build /app/www /var/www/allabiografer.se
41+
COPY etc /etc
42+
COPY init-wrapper /
43+
ENTRYPOINT ["/init-wrapper"]

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# allabiografer.se
2+
3+
A static site aggregating cinema screenings across Sweden. Reimplementation of [allekinos.de](https://allekinos.de/) by [Nikita Tonsky](https://tonsky.me/) for the Sweden.
4+
5+
## Usage
6+
7+
Parse screenings from all supported cinemas:
8+
9+
```
10+
mise run parse
11+
```
12+
13+
Build the static site:
14+
15+
```
16+
mise run build
17+
```
18+
19+
Serve locally:
20+
21+
```
22+
mise run serve
23+
```
24+
25+
## Deployment
26+
27+
Deployed to [Fly.io](https://fly.io).
28+
29+
```
30+
fly deploy
31+
```

data/movies/1005280.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"tmdb_id": 1005280,
3+
"title_sv": "Nyårsfesten",
4+
"title_original": "Nyårsfesten",
5+
"overview_sv": "",
6+
"genres": [],
7+
"release_date": "2018-01-01",
8+
"runtime": 84,
9+
"poster_path": "/7B320Qi9cVfvprehn5ZJN4vRgZ8.jpg",
10+
"vote_average": 0.0,
11+
"age_rating": "",
12+
"release_date_se": "2018-01-01"
13+
}

data/movies/1005280.w500.jpg

Lines changed: 3 additions & 0 deletions
Loading

data/movies/10098.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"tmdb_id": 10098,
3+
"title_sv": "Chaplins pojke",
4+
"title_original": "The Kid",
5+
"overview_sv": "En kvinna lämnar sin nyfödde son i en rikemansbil i hopp om att barnet ska få en bra uppväxt. Bilen blir dock stulen av två skurkar som lämnar av barnet i en fattigmansgränd. Det är här den lille luffaren hittar barnet. Fem år senare lever de som far och son tillsammans i både glädje och sorg.",
6+
"genres": [
7+
"Komedi",
8+
"Drama"
9+
],
10+
"release_date": "1921-01-21",
11+
"runtime": 108,
12+
"poster_path": "/chLYPp4rxUqXEztTZjYe4aAKG7q.jpg",
13+
"vote_average": 8.142,
14+
"age_rating": "Btl",
15+
"release_date_se": "1922-03-20"
16+
}

0 commit comments

Comments
 (0)