Files
docker-node-and-go/.gitea/workflows/build-and-push.yml
Jean-Luc Makiola 31567e0c56
Some checks failed
Build and Push Docker Image / build-and-push (push) Has been cancelled
Initial commit: Dockerfile with Go and Node.js + Gitea Actions workflow
2026-02-23 19:04:55 +01:00

52 lines
1.3 KiB
YAML

name: Build and Push Docker Image
on:
push:
branches:
- main
tags:
- "v*"
env:
REGISTRY: gitea.jeanlucmakiola.de
IMAGE_NAME: ${{ gitea.repository }}
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Gitea Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ gitea.actor }}
password: ${{ secrets.GITEA_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest,enable=${{ gitea.ref == 'refs/heads/main' }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max