2024-04-27 16:18:50 +00:00
|
|
|
name: Build image
|
|
|
|
on:
|
2024-12-01 12:05:11 +00:00
|
|
|
pull_request:
|
|
|
|
paths:
|
|
|
|
- .gitea/workflows/02_build.yaml
|
2024-04-27 16:18:50 +00:00
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- v*
|
2024-11-29 18:37:51 +00:00
|
|
|
|
2024-04-27 16:18:50 +00:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
container:
|
|
|
|
image: docker:dind
|
|
|
|
volumes:
|
|
|
|
- /data/.cache/act:/data/.cache/act
|
|
|
|
- /var/lib/docker/image:/var/lib/docker/image
|
|
|
|
- /var/lib/docker/overlay2:/var/lib/docker/overlay2
|
|
|
|
steps:
|
|
|
|
- name: Starting docker daemon
|
|
|
|
run: docker-init -- dockerd --host=unix:///var/run/docker.sock &
|
|
|
|
- name: Installing necessary packages
|
|
|
|
run: apk add nodejs git curl bash
|
|
|
|
- name: Checkout
|
2024-12-01 12:26:26 +00:00
|
|
|
uses: actions/checkout@v4
|
2024-04-27 16:18:50 +00:00
|
|
|
- name: Docker meta
|
|
|
|
id: meta
|
2024-12-01 12:33:20 +00:00
|
|
|
uses: https://github.com/docker/metadata-action@v5
|
2024-04-27 16:18:50 +00:00
|
|
|
with:
|
|
|
|
# list of Docker images to use as base name for tags
|
|
|
|
images: |
|
|
|
|
git.fai.st/fedi-image-bot/moderation-fe
|
|
|
|
# generate Docker tags based on the following events/attributes
|
|
|
|
tags: |
|
2024-12-01 12:46:27 +00:00
|
|
|
type=raw,value=latest
|
2024-04-27 16:18:50 +00:00
|
|
|
type=ref,event=branch
|
|
|
|
type=semver,pattern={{raw}}
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
- name: Login to fai.st docker registry
|
2024-12-01 12:33:17 +00:00
|
|
|
uses: docker/login-action@v3
|
2024-04-27 16:18:50 +00:00
|
|
|
with:
|
|
|
|
registry: git.fai.st
|
|
|
|
username: ${{ secrets.DOCKER_USER }}
|
|
|
|
password: ${{ secrets.DOCKER_PASS }}
|
|
|
|
- name: Build and push
|
|
|
|
uses: docker/build-push-action@v4
|
|
|
|
with:
|
|
|
|
platforms: linux/amd64,linux/arm64
|
|
|
|
context: .
|
|
|
|
push: true
|
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|