plausible-pageviews-api/.forgejo/workflows/build.yml
Sangelo 8f0645c8b5
All checks were successful
Build and Push Docker Image / docker-build (push) Successful in 34s
[c] set registry and image name statically
2024-10-21 16:00:28 +02:00

54 lines
1.4 KiB
YAML

name: Build and Push Docker Image
on:
push:
branches:
- main
tags:
- "v*"
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ gitea.repository }}
jobs:
docker-build:
runs-on: ubuntu-latest
container:
image: ghcr.io/catthehacker/ubuntu:act-latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock
steps:
- name: ⬇️ Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.FORGEJO_TOKEN }}
- name: 👤 Log in to the Container registry
uses: https://github.com/docker/login-action@v3
with:
registry: gitpot.org
username: ${{ gitea.actor }}
password: ${{ secrets.FORGEJO_TOKEN }}
- name: ✏️ Extract metadata (tags, labels) for Docker
id: meta
uses: https://github.com/docker/metadata-action@v4
with:
images: gitpot.org/sangelo/plausible-pageviews-api
tags: |
type=ref,event=branch
type=ref,event=tag
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: 🛠️ Build and push Docker image
uses: https://github.com/docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}