Skip to content

Commit 65a1206

Browse files
authored
Merge pull request #191 from yubiuser/development
v3.37.0
2 parents f0a8636 + 2932c8b commit 65a1206

10 files changed

Lines changed: 2364 additions & 140 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 37 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -12,123 +12,46 @@ on:
1212
env:
1313
REGISTRY_IMAGE: ghcr.io/yubiuser/webchanges
1414

15+
permissions:
16+
contents: read
17+
1518
jobs:
19+
build-prepare:
20+
runs-on: ubuntu-24.04
21+
outputs:
22+
REGISTRY_IMAGE: ${{ env.REGISTRY_IMAGE }}
23+
steps:
24+
# FIXME: can't use env object in reusable workflow inputs: https://github.com/orgs/community/discussions/26671
25+
- run: echo "Exposing env vars for reusable workflow"
1626
build:
17-
runs-on: ${{ matrix.runner }}
27+
uses: docker/github-builder/.github/workflows/build.yml@v1.15.0
1828
permissions:
1929
contents: read
20-
packages: write
21-
strategy:
22-
fail-fast: true
23-
matrix:
24-
include:
25-
- platform: linux/amd64
26-
runner: ubuntu-latest
27-
- platform: linux/arm64
28-
runner: ubuntu-24.04-arm
29-
steps:
30-
31-
- name: Prepare name for digest up/download
32-
run: |
33-
platform=${{ matrix.platform }}
34-
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
35-
36-
-
37-
name: Checkout Code
38-
uses: actions/checkout@v6.0.2
39-
40-
-
41-
name: Set up QEMU
42-
uses: docker/setup-qemu-action@v4.0.0
43-
44-
-
45-
name: Set up Docker Buildx
46-
uses: docker/setup-buildx-action@v4.0.0
47-
48-
-
49-
name: Extract metadata (tags, labels) for Docker
50-
id: meta
51-
uses: docker/metadata-action@v6
52-
with:
53-
images: |
54-
${{ env.REGISTRY_IMAGE }}
55-
-
56-
name: Login to GitHub Container Registry
57-
uses: docker/login-action@v4.0.0
58-
with:
59-
registry: ghcr.io
60-
username: ${{ github.repository_owner }}
61-
password: ${{ secrets.GITHUB_TOKEN }}
62-
63-
-
64-
name: Build and push Docker image
65-
uses: docker/build-push-action@v7.0.0
66-
id: build
67-
with:
68-
context: .
69-
platforms: ${{ matrix.platform }}
70-
labels: ${{ steps.meta.outputs.labels }}
71-
provenance: false
72-
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=${{ github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'push' || github.event_name == 'release' }}
73-
74-
- name: Export digest
75-
run: |
76-
mkdir -p /tmp/digests
77-
digest="${{ steps.build.outputs.digest }}"
78-
touch "/tmp/digests/${digest#sha256:}"
79-
- name: Upload digest
80-
uses: actions/upload-artifact@v7.0.0
81-
with:
82-
name: digests-${{ env.PLATFORM_PAIR }}
83-
path: /tmp/digests/*
84-
if-no-files-found: error
85-
retention-days: 1
86-
87-
merge:
88-
runs-on: ubuntu-latest
30+
packages: write # required to push to GHCR
31+
id-token: write # for signing attestation(s) with GitHub OIDC Token
8932
needs:
90-
- build
91-
if: |
92-
github.actor != 'dependabot[bot]'
93-
&& ( github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'push' || github.event_name == 'release' )
94-
permissions:
95-
contents: read
96-
packages: write
97-
steps:
98-
- name: Download digests
99-
uses: actions/download-artifact@v8.0.1
100-
with:
101-
path: /tmp/digests
102-
pattern: digests-*
103-
merge-multiple: true
104-
105-
- name: Set up Docker Buildx
106-
uses: docker/setup-buildx-action@v4.0.0
107-
- name: Docker meta
108-
id: meta
109-
uses: docker/metadata-action@v6
110-
with:
111-
images: |
112-
${{ env.REGISTRY_IMAGE }}
113-
tags: |
114-
type=semver,pattern={{version}}
115-
type=semver,pattern={{major}}.{{minor}}
116-
type=semver,pattern={{major}}
117-
type=sha,enable=${{ github.event_name == 'workflow_dispatch' }}
118-
type=ref,event=pr
119-
type=ref,event=branch
120-
- name: Login to GitHub Container Registry
121-
uses: docker/login-action@v4.0.0
122-
with:
123-
registry: ghcr.io
33+
- build-prepare
34+
with:
35+
distribute: true
36+
setup-qemu: true
37+
output: image
38+
cache: true
39+
cache-scope: build
40+
fail-fast: true
41+
push: ${{ github.actor != 'dependabot[bot]' && ( github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'push' || github.event_name == 'release' ) }}
42+
meta-images: ${{ needs.build-prepare.outputs.REGISTRY_IMAGE }}
43+
meta-tags: |
44+
type=semver,pattern={{version}}
45+
type=semver,pattern={{major}}.{{minor}}
46+
type=semver,pattern={{major}}
47+
type=sha,enable=${{ github.event_name == 'workflow_dispatch' }}
48+
type=ref,event=pr
49+
type=ref,event=branch
50+
platforms: linux/amd64,linux/arm64
51+
# FIXME: GHCR does not support the referrers API and spams the registry with sha-tagged images when cosigned: https://github.com/docker/github-builder/issues/109
52+
sign: false
53+
secrets:
54+
registry-auths: |
55+
- registry: ghcr.io
12456
username: ${{ github.repository_owner }}
125-
password: ${{ secrets.GITHUB_TOKEN }}
126-
- name: Create manifest list and push
127-
working-directory: /tmp/digests
128-
run: |
129-
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
130-
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
131-
- name: Inspect image
132-
run: |
133-
docker buildx imagetools inspect --raw ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}
134-
57+
password: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/delete_untagged_images.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: Delete all images from repository without tags
16-
uses: Chizkiyahu/delete-untagged-ghcr-action@v6.1.0
16+
uses: Chizkiyahu/delete-untagged-ghcr-action@v6.1.1
1717
with:
1818
token: ${{ secrets.PAT_TOKEN }}
1919
repository_owner: ${{ github.repository_owner }}

.github/workflows/sync-back-to-dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
name: Syncing branches
1919
steps:
2020
- name: Checkout
21-
uses: actions/checkout@v6.0.2
21+
uses: actions/checkout@v7.0.1
2222
- name: Opening pull request
2323
run: gh pr create -B development -H main --title 'Sync main back into development' --body 'Created by Github action'
2424
env:

Dockerfile

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# syntax=docker/dockerfile:1
2-
ARG webchanges_tag=v3.34.1
2+
ARG webchanges_tag=v3.37.0
33

4-
FROM python:3.14.1-alpine3.22 AS builder
4+
FROM python:3.14.6-alpine3.24 AS builder
55
ARG webchanges_tag
66
ENV PYTHONUTF8=1
77

@@ -32,17 +32,18 @@ RUN python3 -m pip install -r requirements.txt \
3232
# Install some additional packages used by webchanges (optional)
3333
# see https://webchanges.readthedocs.io/en/stable/dependencies.html
3434
RUN python3 -m pip install \
35-
html5lib \
3635
beautifulsoup4 \
37-
jsbeautifier \
36+
chump \
3837
cssbeautifier \
38+
curl_cffi \
39+
html5lib \
3940
jq \
40-
chump \
41-
pyopenssl \
41+
jsbeautifier \
4242
minidb \
43+
pyopenssl \
4344
python-dateutil \
44-
zstandard \
45-
vobject
45+
vobject \
46+
zstandard
4647

4748
# Copy entrypoint script
4849
COPY webchanges.py webchanges.py
@@ -60,7 +61,7 @@ RUN python3 -m PyInstaller -F --strip webchanges.py
6061

6162

6263

63-
FROM alpine:3.23 AS deploy
64+
FROM alpine:3.24.1@sha256:28bd5fe8b56d1bd048e5babf5b10710ebe0bae67db86916198a6eec434943f8b AS deploy
6465
ENV APP_USER=webchanges
6566
ENV PYTHONUTF8=1
6667
RUN apk add --no-cache tini

README.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,20 @@ This repo provides a small docker image for running [webchanges](https://github.
44

55
The following optional dependencies of `webchanges` are included (see [Dependencies](https://webchanges.readthedocs.io/en/stable/dependencies.html#dependencies))
66

7-
| | Comment |
8-
|---|---|
7+
| | Comment |
8+
| --- | --- |
9+
| `beautifulsoup4` | `beautify` filter |
10+
| `chump` | for `pushover` reporter |
11+
| `cssbeautifier` | `beautify` filter |
12+
| `curl_cffi` | to allow curl_cffi backend |
13+
| `html5lib` | parser for the bs4 method of the html2text filter |
14+
| `jq` | |
15+
| `jsbeautifier` | `beautify` filter |
916
| `minidb` | to allow importing legacy `urlwatch` databases |
10-
| `html5lib` | parser for the bs4 method of the html2text filter |
11-
| `beautifulsoup4` | `beautify` filter |
12-
| `jsbeautifier` | `beautify` filter |
13-
| `cssbeautifier` | `beautify` filter |
14-
| `jq` | |
15-
| `chump` | for `pushover` reporter |
16-
| `pyopenssl` | |
17+
| `pyopenssl` | |
1718
| `python-dateutil` | for `--rollback-database` |
18-
| `zstandard` | for Zstandard compression|
1919
| `vobject` | for iCal handling |
20+
| `zstandard` | for Zstandard compression |
2021

2122
## Versioning
2223

crontabfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
*/15 * * * * date && echo "Running webchanges" && cd /data/webchanges && webchanges --jobs jobs.yaml --config config.yaml --database snapshots.db
2-
0 8 * * * date && echo "Checking webchanges jobs for errors" && cd /data/webchanges && webchanges --errors email --jobs jobs.yaml --config config.yaml --database snapshots.db
1+
*/15 * * * * && echo "Running webchanges at $(date)" && cd /data/webchanges && webchanges --jobs jobs.yaml --config config.yaml --database snapshots.db
2+
0 8 * * * echo "Checking webchanges jobs for errors at $(date)" && cd /data/webchanges && webchanges --errors email --jobs jobs.yaml --config config.yaml --database snapshots.db

0 commit comments

Comments
 (0)