diff --git a/.gitea/workflows/publish-docker.yml b/.gitea/workflows/publish-docker.yml new file mode 100644 index 0000000..92ae690 --- /dev/null +++ b/.gitea/workflows/publish-docker.yml @@ -0,0 +1,42 @@ +--- +name: Build and Publish Docker Image +on: + push: + branches: + - main + tags: + - 'v*' + +jobs: + build-and-push: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Log in to Gitea Container Registry + uses: docker/login-action@v3 + with: + registry: git.br0tkasten.de + # Gitea provides these variables automatically + username: ${{ gitea.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: git.br0tkasten.de/${{ gitea.repository }} + tags: | + type=ref,event=branch + type=semver,pattern={{version}} + type=sha + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2d2ecd6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.git/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..860287f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,2 @@ +FROM ubuntu:18.04 +RUN echo 'Hello, World!'