new gitea actions
All checks were successful
Build and Push Multi-Arch Docker Image / build-and-push (push) Successful in 13m52s

Signed-off-by: Peter Siegmund <developer@mars3142.org>
This commit is contained in:
2025-12-15 22:02:51 +01:00
parent 9bb7a2e764
commit b8ae4feb4f
4 changed files with 46 additions and 51 deletions

View File

@@ -0,0 +1,45 @@
name: Build and Push Multi-Arch Docker Image
on:
push:
branches:
- main
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Set Registry Domain
run: |
REGISTRY_DOMAIN=$(echo "${{ github.server_url }}" | sed 's|https://||' | sed 's|http://||')
echo "REGISTRY_DOMAIN=$REGISTRY_DOMAIN" >> $GITHUB_ENV
- name: Login to Gitea Registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY_DOMAIN }}
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Extract Version
run: |
VERSION=$(grep "^version = " build.gradle | sed "s/version = '//" | sed "s/'//")
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "MAJOR=$(echo $VERSION | cut -d. -f1)" >> $GITHUB_ENV
echo "MAJOR_MINOR=$(echo $VERSION | cut -d. -f1,2)" >> $GITHUB_ENV
- name: Build and Push Multi-Arch Image
run: |
docker buildx build \
--platform linux/amd64,linux/arm64 \
-t ${{ env.REGISTRY_DOMAIN }}/${{ github.repository }}/${{ github.event.repository.name }}:latest \
-t ${{ env.REGISTRY_DOMAIN }}/${{ github.repository }}/${{ github.event.repository.name }}:${{ env.MAJOR }} \
-t ${{ env.REGISTRY_DOMAIN }}/${{ github.repository }}/${{ github.event.repository.name }}:${{ env.MAJOR_MINOR }} \
-t ${{ env.REGISTRY_DOMAIN }}/${{ github.repository }}/${{ github.event.repository.name }}:${{ env.VERSION }} \
--push .

View File

@@ -1,11 +0,0 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "gradle"
directory: "/"
schedule:
interval: "weekly"

View File

@@ -1,39 +0,0 @@
---
name: 'deploy to hetzner'
on:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Cloning repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: gradle
- name: Build with Gradle (no Testing)
run: ./gradlew clean build -x test
- name: Push to dokku
timeout-minutes: 20
uses: dokku/github-action@v1
with:
branch: main
git_remote_url: ${{ secrets.HETZNER_GIT_URI }}
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
git_push_flags: --force

View File

@@ -5,7 +5,7 @@ plugins {
} }
group = 'dev.mars3142.fhq' group = 'dev.mars3142.fhq'
version = '0.0.1-SNAPSHOT' version = '0.1.0-SNAPSHOT'
java { java {
toolchain { toolchain {