Skip to content

Commit 444f2ae

Browse files
committed
Fix Docker push permissions and add versioning
1 parent b08e686 commit 444f2ae

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

.github/workflows/docker-build.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ jobs:
1010
build:
1111
runs-on: ubuntu-latest
1212

13+
permissions:
14+
contents: read
15+
packages: write
16+
1317
steps:
1418
- name: Checkout repository
1519
uses: actions/checkout@v4
@@ -47,12 +51,16 @@ jobs:
4751
with:
4852
images: ghcr.io/${{ github.repository }}
4953
tags: |
50-
# set latest tag for default branch
54+
# Use Git tag as the primary version tag (e.g., v1.2.3 -> 1.2.3)
55+
type=semver,pattern={{version}}
56+
# Also tag main branch commit as 'latest'
5157
type=raw,value=latest,enable={{is_default_branch}}
52-
# tag main branch as 'latest' and develop branch as 'develop'
58+
# Tag develop branch commit as 'develop'
59+
type=raw,value=develop,enable={{is_branch 'develop'}}
60+
# Tag other branches with their name
5361
type=ref,event=branch
54-
# tag commit sha
55-
type=sha
62+
# Tag commit sha as well for traceability
63+
type=sha,prefix=sha-
5664
5765
- name: Build and push Docker image
5866
uses: docker/build-push-action@v5

app.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
from urllib.parse import urljoin
1010
from waitress import serve
1111

12+
__version__ = "0.1.0"
13+
1214
# Set up logging
1315
LOG_LEVEL = os.getenv('LOG_LEVEL', 'INFO').upper()
1416
logging.basicConfig(level=LOG_LEVEL, format='%(asctime)s - %(levelname)s - %(message)s')

0 commit comments

Comments
 (0)