ci: Publish Docker image to Gitea registry only
Build & Push Docker Image / docker (push) Failing after 2m34s
Build & Push Docker Image / docker (push) Failing after 2m34s
Add .gitea/workflows/docker.yml that builds the image via Dockerfile.dev and pushes it to the Gitea container registry at git.hackner.dev/thomas/rustdesk-api on pushes to master and on v*.*.* tags. Remove the GitHub Actions workflows (build.yml, build_test.yml): they push to Docker Hub and GHCR (not wanted) and rely on GitHub-only features (GITHUB_TOKEN, GitHub Releases, changelogithub) that do not work on Gitea. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
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 }}
|
||||
Reference in New Issue
Block a user