name: Build & Push Docker Image # Builds the Docker image and publishes it to the Gitea container registry # at git.hackner.dev/thomas/rustdesk-api. # # Requires a running Gitea Actions runner (act_runner) and two repo secrets # (Settings -> Actions -> Secrets): # REGISTRY_USER - Gitea username (e.g. thomas) # REGISTRY_PASSWORD - a Gitea access token with "write:package" scope # # (Alternatively the built-in ${{ secrets.GITHUB_TOKEN }} can be used with # username ${{ gitea.actor }} if your Gitea grants it package write access.) on: push: branches: - master tags: - 'v*.*.*' workflow_dispatch: env: REGISTRY: git.hackner.dev IMAGE_NAME: ${{ github.repository }} # -> thomas/rustdesk-api jobs: docker: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Log in to the Gitea container registry uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} username: ${{ secrets.REGISTRY_USER }} password: ${{ secrets.REGISTRY_PASSWORD }} - name: Extract metadata (tags, labels) id: meta uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | type=semver,pattern={{version}} type=raw,value=latest,enable={{is_default_branch}} - name: Build and push image uses: docker/build-push-action@v6 with: context: . file: ./Dockerfile.dev push: true build-args: | GO_VERSION=1.23 tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }}