Compare commits

...

3 Commits

Author SHA1 Message Date
e7b5023134 feat: create reusable action for setting up Docker environment in workflows
Some checks failed
Build Docker Image for Pull Request / build (pull_request) Failing after 6s
2025-02-09 15:57:50 +01:00
80adb79196 feat: add GitHub Actions workflow for building Docker images on feature PRs
All checks were successful
Build Docker Image for Feature PRs / build (pull_request) Successful in 1m29s
2025-02-09 15:16:50 +01:00
6614a7dca9 feat: add GitHub Actions workflow for building and pushing Docker images 2025-02-09 15:01:03 +01:00
3 changed files with 71 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
name: "Setup Docker Environment"
description: "Common steps for setting up Docker build environment (checkout, QEMU, and Buildx)"
runs:
using: "composite"
steps:
- name: Checkout repository
uses: actions/checkout@v4.2.2
- name: Set up QEMU
uses: docker/setup-qemu-action@v3.4.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.9.0

24
.github/workflows/feature-pr-build.yml vendored Normal file
View File

@@ -0,0 +1,24 @@
name: Build Docker Image for Pull Request
on:
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Setup Docker Environment
uses: ./.github/actions/setup-docker-environment
- name: Build Docker image
uses: docker/build-push-action@v6.13.0
with:
context: .
push: false
tags: ${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ github.event.pull_request.number }}
platforms: |
linux/amd64
linux/arm64

33
.github/workflows/main.yml vendored Normal file
View File

@@ -0,0 +1,33 @@
name: Build and Push Docker Image
on:
push:
branches:
- main
env:
REGISTRY_URL: gitea.kobim.cloud
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Setup Docker Environment
uses: ./.github/actions/setup-docker-environment
- name: Log in to Docker registry
uses: docker/login-action@v3.3.0
with:
registry: ${{ env.REGISTRY_URL }}
username: ${{ github.actor }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v6.13.0
with:
context: .
push: true
tags: ${{ env.REGISTRY_URL }}/${{ github.repository_owner }}/${{ github.event.repository.name }}:latest
platforms: |
linux/amd64
linux/arm64