Skip to content

Commit 5e11cb9

Browse files
committed
add docker image GH workflow
1 parent 8293ecc commit 5e11cb9

File tree

6 files changed

+117
-34
lines changed

6 files changed

+117
-34
lines changed

.github/workflows/cicd.yml

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: CICD
2+
on: [ push, pull_request ]
3+
4+
env:
5+
REGISTRY: ghcr.io
6+
IMAGE_NAME: ${{ github.repository }}
7+
8+
jobs:
9+
ruff:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: astral-sh/ruff-action@v3
14+
15+
tests:
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
python-version: ["3.13"]
20+
os: [ubuntu-24.04, macos-latest, windows-latest]
21+
22+
runs-on: ${{ matrix.os }}
23+
steps:
24+
- uses: actions/checkout@v4
25+
26+
- name: Install uv
27+
uses: astral-sh/setup-uv@v5
28+
with:
29+
enable-cache: true
30+
python-version: ${{ matrix.python-version }}
31+
32+
- name: Install the project
33+
run: uv sync --all-extras --dev
34+
35+
- name: Run tests
36+
run: uv run pytest
37+
38+
docker:
39+
strategy:
40+
fail-fast: false
41+
matrix:
42+
os: [ubuntu-24.04, ubuntu-24.04-arm]
43+
44+
permissions:
45+
contents: read
46+
packages: write
47+
attestations: write
48+
id-token: write
49+
50+
runs-on: ${{ matrix.os }}
51+
needs: [ ruff, tests ]
52+
steps:
53+
- name: Checkout repository
54+
uses: actions/checkout@v4
55+
56+
- name: Log in to the Container registry
57+
uses: docker/login-action@v3
58+
with:
59+
registry: ${{ env.REGISTRY }}
60+
username: ${{ github.actor }}
61+
password: ${{ secrets.GITHUB_TOKEN }}
62+
63+
- name: Extract metadata (tags, labels) for Docker
64+
id: meta
65+
uses: docker/metadata-action@v5
66+
with:
67+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
68+
69+
- name: Set up Docker Buildx
70+
uses: docker/setup-buildx-action@v3
71+
72+
- name: Build and push Docker image
73+
id: push
74+
uses: docker/build-push-action@v6
75+
with:
76+
context: .
77+
push: true
78+
provenance: false
79+
tags: ${{ steps.meta.outputs.tags }}
80+
labels: ${{ steps.meta.outputs.labels }}
81+
82+
- name: Generate artifact attestation
83+
uses: actions/attest-build-provenance@v2
84+
with:
85+
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
86+
subject-digest: ${{ steps.push.outputs.digest }}
87+
push-to-registry: true
File renamed without changes.

.github/workflows/tests.yml

-32
This file was deleted.

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Prowl
22

3-
[![Tests Status](https://img.shields.io/github/actions/workflow/status/nxthdr/prowl/tests.yml?logo=github&label=tests)](https://github.com/nxthdr/prowl/actions/workflows/tests.yml)
3+
[![CICD Status](https://img.shields.io/github/actions/workflow/status/nxthdr/prowl/cicd.yml?logo=github&label=cicd)](https://github.com/nxthdr/prowl/actions/workflows/cicd.yml)
44
[![PyPI](https://img.shields.io/pypi/v/prowl?color=blue&logo=pypi&logoColor=white)](https://pypi.org/project/prowl/)
55

66
> [!WARNING]

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ cli = [
1717
dev = [
1818
"bump-my-version>=1.0.1",
1919
"pytest>=8.3.5",
20+
"ruff>=0.9.9",
2021
]

uv.lock

+28-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)