44 lines
1.1 KiB
YAML
44 lines
1.1 KiB
YAML
# Based on: https://pastebin.com/99Fq2b2w
|
|
name: Build and deploy censorbot
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
- feature/**
|
|
tags:
|
|
- v*.*.*
|
|
|
|
jobs:
|
|
container:
|
|
name: Build Docker image
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Docker meta
|
|
id: meta
|
|
uses: https://github.com/docker/metadata-action@v5
|
|
with:
|
|
images: git.huizinga.dev/dreaded_x/pre-commit
|
|
tags: |
|
|
type=ref,event=branch
|
|
type=ref,event=pr
|
|
type=semver,pattern={{version}}
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
|
|
- name: Login to registry
|
|
uses: https://github.com/docker/login-action@v3
|
|
with:
|
|
registry: git.huizinga.dev
|
|
username: ${{ gitea.actor }}
|
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
|
|
|
- name: Build and push Docker image
|
|
uses: https://github.com/docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|