This commit is contained in:
23
.gitea/workflows/build-and-push.yaml
Normal file
23
.gitea/workflows/build-and-push.yaml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
name: Build and Push Docker Image (Simple)
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: runner
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
run: |
|
||||||
|
# Login to Gitea registry
|
||||||
|
echo "${{ secrets.GITEATOKEN }}" | docker login ${{ gitea.server_url }} -u ${{ gitea.actor }} --password-stdin
|
||||||
|
|
||||||
|
# Build the image
|
||||||
|
docker build -t ${{ gitea.server_url }}/${{ gitea.repository_owner }}/hello-gitea:latest .
|
||||||
|
|
||||||
|
# Push to registry
|
||||||
|
docker push ${{ gitea.server_url }}/${{ gitea.repository_owner }}/hello-gitea:latest
|
||||||
5
Dockerfile
Normal file
5
Dockerfile
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
FROM python:3.14-slim
|
||||||
|
WORKDIR /app
|
||||||
|
COPY hello.py .
|
||||||
|
RUN chmod +x hello.py
|
||||||
|
CMD ["python", "hello.py"]
|
||||||
Reference in New Issue
Block a user