diff --git a/.gitea/workflows/docker-image-dev.yml b/.gitea/workflows/docker-image-dev.yml new file mode 100644 index 0000000..d61ab50 --- /dev/null +++ b/.gitea/workflows/docker-image-dev.yml @@ -0,0 +1,41 @@ +name: Build And Push Dev Docker Image + +on: + push: + branches: + - master + 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: Build docker image + run: | + docker build \ + -f ./Docker/dockerfile.server \ + -t "${{ env.BASE_IMAGE }}:dev" \ + . + + - name: Push docker images + run: | + docker push "${{ env.BASE_IMAGE }}:dev" diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml deleted file mode 100644 index df6ad00..0000000 --- a/.gitea/workflows/test.yml +++ /dev/null @@ -1,50 +0,0 @@ -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 }}