Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
version: 2
updates:
- package-ecosystem: "pip"
- package-ecosystem: "uv"
directory: "/"
schedule:
interval: "weekly"
interval: "monthly"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
interval: "monthly"
47 changes: 47 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Deploy to static server

on:
push:
branches:
- ep2024
workflow_dispatch:

jobs:
tests:
name: Run tests
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Python 3
uses: actions/setup-python@v5
with:
python-version: '3.13'

- name: Setup uv
uses: astral-sh/setup-uv@v5

- name: Install dependencies from uv.lock
run: make deps/install

- name: Download data
run: uv run make download > /dev/null
env:
PRETALX_TOKEN: ${{ secrets.PRETALX_TOKEN }}

- name: Transform data
run: uv run make transform > /dev/null

- name: Setup SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}

- name: Adjust known_hosts
run: ssh-keyscan "static.europython.eu" > ~/.ssh/known_hosts

- name: Deploy
run: uv run make deploy FORCE_DEPLOY=true > /dev/null
10 changes: 6 additions & 4 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ jobs:
- name: Set up Python 3
uses: actions/setup-python@v5
with:
python-version: '3.x'
cache: "pip"
python-version: '3.13'

- name: Install dependencies
run: make deps/pre install
- name: Setup uv
uses: astral-sh/setup-uv@v5

- name: Install dependencies from uv.lock
run: make deps/install

- name: Run pytest
run: make test
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,6 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

# Ruff:
.ruff_cache/
29 changes: 9 additions & 20 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
repos:
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort

- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.10.0
hooks:
- id: black

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
Expand All @@ -19,19 +9,18 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.4
rev: v0.11.4
hooks:
- id: ruff
args: [ --fix ]
- id: ruff-format

- repo: local
- repo: https://github.com/tox-dev/pyproject-fmt
rev: v2.5.1
hooks:
- id: pytest
name: Run pytest
entry: make test
language: system
pass_filenames: false
always_run: true
- id: pyproject-fmt

ci:
skip: [pytest]
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.24.1
hooks:
- id: validate-pyproject
1 change: 0 additions & 1 deletion .python-version

This file was deleted.

15 changes: 0 additions & 15 deletions Dockerfile

This file was deleted.

39 changes: 32 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
# Variables for the project
# =========================
CONFERENCE ?= ep2024
DATA_DIR ?= ./data/public/$(CONFERENCE)/

deps/pre:
pip install pip-tools
# Variables for remote host
# =========================
VPS_USER ?= static_content_user
VPS_HOST ?= static.europython.eu
VPS_PATH ?= /home/$(VPS_USER)/content/programapi/$(CONFERENCE)/releases
REMOTE_CMD=ssh $(VPS_USER)@$(VPS_HOST)

deps/compile:
pip-compile
# Variables for deploy
# ==========================
TIMESTAMP ?= $(shell date +%Y%m%d%H%M%S)
FORCE_DEPLOY ?= false

dev:
uv sync --dev

deps/upgrade:
uv lock --upgrade

deps/install:
pip-sync
uv sync

install: deps/install

Expand All @@ -22,12 +38,21 @@ endif

all: download transform

ifeq ($(FORCE_DEPLOY), true)
deploy: TARGET = $(VPS_PATH)/$(TIMESTAMP)
deploy:
@echo "\n\n**** Deploying branch '$(CONFERENCE)' to $(TARGET)...\n\n"
$(REMOTE_CMD) "mkdir -p $(TARGET)"
rsync -avz --delete $(DATA_DIR) $(VPS_USER)@$(VPS_HOST):$(TARGET)
$(REMOTE_CMD) "cd $(VPS_PATH) && ln -snf $(TIMESTAMP) current"
@echo "\n\n**** Deployment complete.\n\n"
endif

test:
PYTHONPATH="src" pytest
uv run pytest

pre-commit:
pre-commit install
pre-commit run --all-files

clean:
git clean -xdf
1 change: 0 additions & 1 deletion deploy/.python-version

This file was deleted.

11 changes: 0 additions & 11 deletions deploy/Makefile

This file was deleted.

28 changes: 0 additions & 28 deletions deploy/docker-compose.yml.j2

This file was deleted.

1 change: 0 additions & 1 deletion deploy/env.example

This file was deleted.

2 changes: 0 additions & 2 deletions deploy/hosts.ini

This file was deleted.

80 changes: 0 additions & 80 deletions deploy/init-letsencrypt.sh.j2

This file was deleted.

Loading