containers/.forgejo/workflows/main.yml

42 lines
1 KiB
YAML
Raw Normal View History

2025-07-11 12:52:38 +02:00
name: Build and Push Docker Image
run-name: Build and Push Docker Image
on:
push:
branches:
2025-07-11 13:23:58 +02:00
- main
2025-07-11 12:52:38 +02:00
workflow_dispatch: {}
schedule:
2025-07-11 13:23:58 +02:00
- cron: '0 20 * * 5'
2025-07-11 12:52:38 +02:00
jobs:
build-and-push:
2025-07-11 13:23:58 +02:00
# The runner with this label must have Docker installed to be able to run service containers.
2025-07-11 12:52:38 +02:00
runs-on: node
2025-07-11 13:23:58 +02:00
services:
dind:
image: docker:24-dind
options: --privileged
2025-07-11 12:52:38 +02:00
steps:
2025-07-11 13:23:58 +02:00
- name: Checkout
uses: actions/checkout@v4
2025-07-11 12:52:38 +02:00
2025-07-11 13:23:58 +02:00
- name: Set up Docker Builder
# This action will automatically use the 'dind' service as the build server.
uses: docker/setup-buildx-action@v3
2025-07-11 12:52:38 +02:00
2025-07-11 13:23:58 +02:00
- name: Login to Forgejo Registry
uses: docker/login-action@v3
with:
registry: ${{ secrets.CI_REGISTRY }}
username: ${{ secrets.CI_REGISTRY_USER }}
password: ${{ secrets.CI_TOKEN }}
2025-07-11 12:52:38 +02:00
2025-07-11 13:23:58 +02:00
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64
push: true
tags: ${{ secrets.CI_REGISTRY }}/${{ secrets.CI_REPOSITORY }}:latest