Skip to content

Commit 61c49bf

Browse files
authored
chore: build and publish dockerfile
docker build Todo: add dockerfile
1 parent 5e24855 commit 61c49bf

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

.github/workflows/ci.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ concurrency:
1212

1313
env:
1414
PYTHON_VERSION: "3.13"
15+
REGISTRY: ghcr.io
16+
IMAGE_NAME: ${{ github.repository }}
1517

1618
jobs:
1719
determine_changes:
@@ -69,3 +71,45 @@ jobs:
6971

7072
- name: "Validate project metadata"
7173
run: uvx --from 'validate-pyproject[all,store]' validate-pyproject pyproject.toml
74+
75+
build-and-publish:
76+
runs-on: ubuntu-latest
77+
78+
permissions:
79+
contents: read
80+
packages: write
81+
# attestations: write
82+
id-token: write
83+
84+
steps:
85+
- name: Checkout repository
86+
uses: actions/checkout@v4
87+
88+
- name: Log in to the Container registry
89+
uses: docker/login-action@v3
90+
with:
91+
registry: ${{ env.REGISTRY }}
92+
username: ${{ github.actor }}
93+
password: ${{ secrets.GITHUB_TOKEN }}
94+
95+
- name: Extract metadata (tags, labels) for Docker
96+
id: meta
97+
uses: docker/metadata-action@v5
98+
with:
99+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
100+
101+
- name: Set up Docker Buildx
102+
uses: docker/setup-buildx-action@v3
103+
104+
- name: Build and push Docker image
105+
id: push
106+
uses: docker/build-push-action@v6
107+
with:
108+
context: ./
109+
file: ./Dockerfile
110+
platforms: linux/amd64
111+
push: true
112+
tags: ${{ steps.meta.outputs.tags }}
113+
labels: ${{ steps.meta.outputs.labels }}
114+
cache-from: type=gha
115+
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)