diff --git a/.gitea/workflows/build-and-push.yaml b/.gitea/workflows/build-and-push.yaml new file mode 100644 index 0000000..0bcdbe2 --- /dev/null +++ b/.gitea/workflows/build-and-push.yaml @@ -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 \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..31e9a20 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM python:3.14-slim +WORKDIR /app +COPY hello.py . +RUN chmod +x hello.py +CMD ["python", "hello.py"] \ No newline at end of file diff --git a/hello.py b/hello.py new file mode 100644 index 0000000..1ce4856 --- /dev/null +++ b/hello.py @@ -0,0 +1,3 @@ +#!/usr/bin/env python3 +print("Hello from a Gitea hosted Docker repo built on the runner! 🚀") +print("This image was built using Gitea Actions and stored in Gitea's registry.") \ No newline at end of file