From 60f7e372e2250804fc93159dbe44981972c1bcb8 Mon Sep 17 00:00:00 2001 From: Peter Siegmund Date: Thu, 18 Dec 2025 22:54:48 +0100 Subject: [PATCH] add actions Signed-off-by: Peter Siegmund --- .gitea/workflows/docker.yml | 51 +++++++++++++++++++++++++++ .github/dependabot.yml | 11 ------ .github/workflows/deploy-hetzner.yaml | 39 -------------------- pom.xml | 2 +- 4 files changed, 52 insertions(+), 51 deletions(-) create mode 100644 .gitea/workflows/docker.yml delete mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/deploy-hetzner.yaml diff --git a/.gitea/workflows/docker.yml b/.gitea/workflows/docker.yml new file mode 100644 index 0000000..4bc3aa8 --- /dev/null +++ b/.gitea/workflows/docker.yml @@ -0,0 +1,51 @@ +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: Set up JDK + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + + - name: Extract Version + run: | + VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout) + 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 }}:latest \ + -t ${{ env.REGISTRY_DOMAIN }}/${{ github.repository }}:${{ env.MAJOR }} \ + -t ${{ env.REGISTRY_DOMAIN }}/${{ github.repository }}:${{ env.MAJOR_MINOR }} \ + -t ${{ env.REGISTRY_DOMAIN }}/${{ github.repository }}:${{ env.VERSION }} \ + --push . diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index cbc0c13..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,11 +0,0 @@ -version: 2 -updates: - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "weekly" - - - package-ecosystem: "maven" - directory: "/" - schedule: - interval: "weekly" diff --git a/.github/workflows/deploy-hetzner.yaml b/.github/workflows/deploy-hetzner.yaml deleted file mode 100644 index 1ce59b7..0000000 --- a/.github/workflows/deploy-hetzner.yaml +++ /dev/null @@ -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: maven - - - name: Build and test with Maven - run: mvn --batch-mode --update-snapshots verify - - - 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 diff --git a/pom.xml b/pom.xml index 1f11503..b4c44b5 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ dev.mars3142.fhq website website - 1.0-SNAPSHOT + 0.1.0-SNAPSHOT jar