Skip to content

Commit 8b82a59

Browse files
committed
Publish Docker image with GitHub Actions
1 parent 9824174 commit 8b82a59

2 files changed

Lines changed: 33 additions & 0 deletions

File tree

.github/workflows/docker.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Build container image
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
packages: write
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: docker/login-action@v3
18+
with:
19+
registry: ghcr.io
20+
username: ${{ github.actor }}
21+
password: ${{ secrets.GITHUB_TOKEN }}
22+
- uses: docker/setup-buildx-action@v3
23+
- uses: docker/build-push-action@v6
24+
with:
25+
context: .
26+
push: true
27+
tags: |
28+
ghcr.io/jan370/logto-demo:latest
29+
ghcr.io/jan370/logto-demo:${{ github.sha }}
30+
cache-from: type=gha
31+
cache-to: type=gha,mode=max

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
FROM python:3.13-slim
22

3+
LABEL org.opencontainers.image.source="https://github.com/jan370/logto-demo"
4+
35
ENV PYTHONDONTWRITEBYTECODE=1 \
46
PYTHONUNBUFFERED=1
57

0 commit comments

Comments
 (0)