fix: simplify Gitea Actions workflow for Docker build
Build and Push Docker Image / build (push) Successful in 55s
Build and Push Docker Image / build (push) Successful in 55s
Use native Docker commands instead of GitHub Actions docker/* actions which may not be available in Gitea Actions environment. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
01aebf9e02
commit
b24f89e78d
1 file changed
+10
-36
@@ -5,50 +5,24 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
env:
|
|
||||||
REGISTRY: gitea.samson.media
|
|
||||||
IMAGE_NAME: samson-media/brave-search-mcp-server
|
|
||||||
REGISTRY_USER: ci@samson.media
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
packages: write
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Build Docker image
|
||||||
uses: docker/setup-buildx-action@v3
|
run: |
|
||||||
|
docker build -t gitea.samson.media/samson-media/brave-search-mcp-server:latest .
|
||||||
|
docker build -t "gitea.samson.media/samson-media/brave-search-mcp-server:${GITHUB_SHA:0:7}" .
|
||||||
|
|
||||||
- name: Log in to Gitea Registry
|
- name: Log in to Gitea Registry
|
||||||
uses: docker/login-action@v3
|
run: |
|
||||||
with:
|
echo "${{ secrets.CI_TOKEN }}" | docker login -u ci@samson.media --password-stdin gitea.samson.media
|
||||||
registry: ${{ env.REGISTRY }}
|
|
||||||
username: ${{ env.REGISTRY_USER }}
|
|
||||||
password: ${{ secrets.CI_TOKEN }}
|
|
||||||
|
|
||||||
- name: Extract metadata
|
- name: Push Docker image
|
||||||
id: meta
|
run: |
|
||||||
uses: docker/metadata-action@v5
|
docker push gitea.samson.media/samson-media/brave-search-mcp-server:latest
|
||||||
with:
|
docker push "gitea.samson.media/samson-media/brave-search-mcp-server:${GITHUB_SHA:0:7}"
|
||||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
|
||||||
tags: |
|
|
||||||
type=ref,event=branch
|
|
||||||
type=semver,pattern={{version}}
|
|
||||||
type=semver,pattern={{major}}.{{minor}}
|
|
||||||
type=sha,prefix={{branch}}-
|
|
||||||
type=raw,value=latest,enable={{is_default_branch}}
|
|
||||||
|
|
||||||
- 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 }}
|
|
||||||
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache
|
|
||||||
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache,mode=max
|
|
||||||
Reference in new issue
Block a user