# # .gitea/gitea-ci.yaml # name: Build Docker Container using Multistage Build run-name: ${{ gitea.actor }} started ci pipeline on: push: branches: - main tags: - "v*" # Tags, die mit "v" anfangen, z. B. v1.0.0 workflow_dispatch: jobs: build: runs-on: ubuntu-latest steps: - uses: https://github.com/actions/checkout@v6 - name: Docker login to Gitea Registry run: | echo "${{ secrets.DOCKER_PASSWORD }}" | docker login git.hnrx.net \ --username "${{ secrets.DOCKER_USERNAME }}" --password-stdin - name: Setup Docker Buildx uses: docker/setup-buildx-action@v3 with: buildkitd-config-inline: | [registry."docker.io"] mirrors = ["docker.hnrx.net"] [registry."git.hnrx.net"] username = "${{ secrets.DOCKER_USERNAME }}" password = "${{ secrets.DOCKER_PASSWORD }}" - run: ls -lha - name: Build and Push Docker latest Image if: gitea.ref == 'refs/heads/main' uses: docker/build-push-action@v6 with: context: . push: true tags: git.hnrx.net/hnrx/manage-servers:latest file: ./Dockerfile - name: Build and Push Docker versioned Image ${{ gitea.ref_name }} if: startsWith(gitea.ref, 'refs/tags/v') uses: docker/build-push-action@v6 with: context: . push: true tags: git.hnrx.net/hnrx/manage-servers:${{ gitea.ref_name }} file: ./Dockerfile