Fix: Simplify Gitea Actions workflow to use docker runner
Some checks failed
Build and Push Docker Image / build (push) Failing after 7s

This commit is contained in:
Ben
2025-12-28 05:29:04 +00:00
parent 9931bdf2e4
commit 06399c273b

View File

@@ -6,50 +6,26 @@ on:
- main - main
tags: tags:
- 'v*' - 'v*'
pull_request:
branches:
- main
env:
REGISTRY: gitea.ext.ben.io
IMAGE_NAME: b3nw/plex-mcp
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: docker
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Set up Docker Buildx - name: Extract tag
uses: docker/setup-buildx-action@v3 id: extract
run: |
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
echo "tag=latest" >> $GITHUB_OUTPUT
elif [[ "${{ github.ref }}" == refs/tags/* ]]; then
TAG=${GITHUB_REF#refs/tags/}
echo "tag=${TAG}" >> $GITHUB_OUTPUT
fi
- name: Log in to Gitea Container Registry - name: Build and Push Docker Image
uses: docker/login-action@v3 run: |
with: docker build -t git.local.ben.io/b3nw/plex-mcp:${{ steps.extract.outputs.tag }} .
registry: ${{ env.REGISTRY }} docker login -u ${{ secrets.REGISTRY_USERNAME }} -p ${{ secrets.REGISTRY_PASSWORD }} git.local.ben.io
username: ${{ secrets.REGISTRY_USERNAME }} docker push git.local.ben.io/b3nw/plex-mcp:${{ steps.extract.outputs.tag }}
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=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha,prefix=
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max