Skip to content

Commit 7ecbdac

Browse files
committed
dockerfile and build publish action
1 parent 1cc1bd0 commit 7ecbdac

File tree

2 files changed

+67
-0
lines changed

2 files changed

+67
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Submission Snapshot Lint
2+
on:
3+
push:
4+
paths:
5+
- 'submission-snapshot/**'
6+
7+
jobs:
8+
build-pusg:
9+
runs-on: ubuntu-latest
10+
11+
permissions:
12+
contents: read
13+
packages: write
14+
15+
steps:
16+
- uses: actions/checkout@v5
17+
18+
- name: Log in to GitHub Container Registry
19+
uses: docker/login-action@v3
20+
with:
21+
registry: ghcr.io
22+
username: ${{ github.actor }}
23+
password: ${{ secrets.GITHUB_TOKEN }}
24+
25+
- name: Short commit SHA
26+
run: echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
27+
28+
- name: Prepare image name
29+
run: |
30+
IMAGE_NAME="ghcr.io/${GITHUB_REPOSITORY,,}/submission-snapshot:${SHORT_SHA}"
31+
echo "IMAGE_NAME=$IMAGE_NAME" >> $GITHUB_ENV
32+
33+
- name: Build Docker image
34+
run: |
35+
echo "Building image: $IMAGE_NAME"
36+
docker build -t $IMAGE_NAME ./submission-snapshot
37+
38+
- name: Push Docker image
39+
run: |
40+
echo "Pushing image: $IMAGE_NAME"
41+
docker push $IMAGE_NAME

submission-snapshot/Dockerfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
FROM ghcr.io/astral-sh/uv:0.10.7-python3.14-trixie-slim
2+
3+
4+
# Setup a non-root user
5+
RUN groupadd --system --gid 999 pcgl \
6+
&& useradd --system --gid 999 --uid 999 --create-home pcgl
7+
8+
9+
WORKDIR /workflow
10+
11+
COPY pyproject.toml .
12+
COPY uv.lock .
13+
COPY main.py .
14+
15+
# Install uv
16+
17+
# Disable development dependencies
18+
ENV UV_NO_DEV=1
19+
20+
# Install dependencies
21+
RUN uv sync --locked
22+
23+
USER pcgl
24+
25+
# Run workflow
26+
CMD [ "uv", "run", "main.py" ]

0 commit comments

Comments
 (0)