Compare commits

...

2 Commits

Author SHA1 Message Date
b73118266c Minor fixes to gitea actions
Some checks failed
release / Build and push Docker image (push) Failing after 2m53s
2025-01-04 16:02:25 +03:30
9c27064237 Remove dotnet build in gitea actions 2025-01-04 15:57:07 +03:30

View File

@@ -9,29 +9,6 @@ env:
ASPNETCORE_ENVIRONMENT: Production
jobs:
build:
name: Build .NET Application
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # all history for all branches and tags
- name: Install dependencies and .NET sdk
run: sudo add-apt-repository ppa:dotnet/backports && sudo apt-get update && sudo apt-get install -y tar dotnet-sdk-9.0
- name: Install telegram bot library
run: dotnet nuget add source https://pkgs.dev.azure.com/tgbots/Telegram.Bot/_packaging/release/nuget/v3/index.json -n Telegram.Bot
- name: dotnet publish
run: dotnet publish -c Release -r linux-x64 --self-contained true /p:PublishSingleFile=true /p:PublishTrimmed=false /p:EnableCompressionInSingleFile=true
- name: Create tarball
run: tar -czvf publish.tar.gz -C bin/Release/net9.0/linux-x64/publish/ .
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: publish-x86_64-self-contained
path: publish.tar.gz
compression-level: 9
docker:
name: Build and push Docker image
runs-on: ubuntu-latest
@@ -47,15 +24,15 @@ jobs:
registry: git.mahdium.ir
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
- name: Cache Docker layers
id: cache-layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.ref }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-${{ github.ref }}-
${{ runner.os }}-buildx-
# - name: Cache Docker layers
# id: cache-layers
# uses: actions/cache@v3
# with:
# path: /tmp/.buildx-cache
# key: ${{ runner.os }}-buildx-${{ github.ref }}-${{ github.sha }}
# restore-keys: |
# ${{ runner.os }}-buildx-${{ github.ref }}-
# ${{ runner.os }}-buildx-
- name: Extract Docker metadata
id: meta
@@ -69,5 +46,5 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
cache-from: type=registry,ref=user/app:latest
cache-to: type=inline