Compare commits

..

3 Commits

Author SHA1 Message Date
troogs
aea858a1ef Add GitHub Actions workflow for building and pushing Docker images
All checks were successful
Build And Push Docker Image / docker (push) Successful in 1m50s
2026-04-10 21:17:51 +02:00
troogs
85c90e4657 Add DOTNET_ROLL_FORWARD environment variable to build workflow
All checks were successful
Build And Release / release (push) Successful in 1m26s
2026-04-10 20:56:12 +02:00
troogs
840ecedbd0 Add GitHub Actions workflow for build and release process
Some checks failed
Build And Release / release (push) Failing after 1m8s
2026-04-10 20:52:03 +02:00
2 changed files with 106 additions and 0 deletions

View File

@@ -0,0 +1,56 @@
name: Build And Push Docker Image
on:
push:
tags:
- "image"
workflow_dispatch:
jobs:
docker:
runs-on: ubuntu-latest
env:
DOTNET_ROLL_FORWARD: Major
REGISTRY: git.beging.de
BASE_IMAGE: git.beging.de/troogs/fs-onboarding-server
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup .NET SDK
uses: actions/setup-dotnet@v5
with:
dotnet-version: "9.0.x"
- name: Publish server project
run: dotnet publish ./FoodsharingSiegen.Server/FoodsharingSiegen.Server.csproj -c Release -o ./Publish/Server
- name: Login to Gitea registry
run: echo "${{ secrets.REGISTRY_TOKEN }}" | docker login "${{ env.REGISTRY }}" -u "${{ secrets.REGISTRY_USERNAME }}" --password-stdin
- name: Determine next timestamp tag
shell: bash
run: |
TODAY="$(date -u +%Y%m%d)"
i=1
while docker manifest inspect "${BASE_IMAGE}:${TODAY}-${i}" > /dev/null 2>&1; do
i=$((i + 1))
done
DATE_TAG="${TODAY}-${i}"
echo "DATE_TAG=${DATE_TAG}" >> "$GITHUB_ENV"
echo "Using image tag: ${DATE_TAG}"
- name: Build docker image
run: |
docker build \
-f ./Docker/dockerfile.server \
-t "${{ env.BASE_IMAGE }}:latest" \
-t "${{ env.BASE_IMAGE }}:${{ env.DATE_TAG }}" \
.
- name: Push docker images
run: |
docker push "${{ env.BASE_IMAGE }}:latest"
docker push "${{ env.BASE_IMAGE }}:${{ env.DATE_TAG }}"

50
.gitea/workflows/test.yml Normal file
View File

@@ -0,0 +1,50 @@
name: Build And Release
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
tag_name:
description: "Tag for the release (for example: v1.0.0)"
required: true
type: string
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
env:
RELEASE_TAG: ${{ github.event.inputs.tag_name || github.ref_name }}
DOTNET_ROLL_FORWARD: Major
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup .NET SDK
uses: actions/setup-dotnet@v5
with:
dotnet-version: "9.0.x"
- name: Restore dependencies
run: dotnet restore FoodsharingSiegen.sln
- name: Publish server build
run: dotnet publish ./FoodsharingSiegen.Server/FoodsharingSiegen.Server.csproj -c Release -o ./artifacts/publish
- name: Create zip package
run: |
cd artifacts
zip -r FoodsharingSiegen.Server-${{ env.RELEASE_TAG }}.zip publish
- name: Create release and upload artifact
uses: https://gitea.com/actions/gitea-release-action@v1
with:
files: artifacts/FoodsharingSiegen.Server-${{ env.RELEASE_TAG }}.zip
tag_name: ${{ env.RELEASE_TAG }}
name: Release ${{ env.RELEASE_TAG }}
target_commitish: ${{ github.sha }}
token: ${{ github.token }}