All checks were successful
Caddy Manager CI build / docker (push) Successful in 6m37s
Preserve configuration defaults with the .NET 10 binder and update dependencies, Docker builds, CI, and test tooling.
53 lines
2.0 KiB
YAML
53 lines
2.0 KiB
YAML
name: Caddy Manager CI build
|
|
run-name: ${{ gitea.actor }} is running CI pipeline
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
docker:
|
|
env:
|
|
RUNNER_TOOL_CACHE: /toolcache
|
|
NUGET_PACKAGES: ${{ gitea.workspace }}/.nuget/packages
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
-
|
|
name: Login to Gitea
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: http://${{ vars.DOCKER_GITEA_DOMAIN }}
|
|
username: ${{ vars.DOCKER_GITEA_USERNAME }}
|
|
password: ${{ secrets.DOCKER_GITEA_PAT }}
|
|
config-inline: |
|
|
[registry."${{ vars.DOCKER_GITEA_DOMAIN }}"]
|
|
http = true
|
|
insecure = true
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-dotnet@v4
|
|
with:
|
|
dotnet-version: '10' # SDK Version to use.
|
|
dotnet-quality: 'ga'
|
|
cache: true
|
|
cache-dependency-path: '**/packages.lock.json'
|
|
- name: Restore dependencies
|
|
run: dotnet restore --locked-mode
|
|
- name: Application metadata
|
|
id: metadata
|
|
run: |
|
|
echo "COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
|
|
echo "APP_VERSION=$(grep 'public static readonly string Version' CaddyManager/Configurations/Application/ApplicationInfo.cs | sed -E 's/.*"([^"]+)".*/\1/')" >> $GITHUB_OUTPUT
|
|
- name: Patch application info
|
|
run: |
|
|
sed -i "s/public static readonly string CommitHash = \"\[DEVELOPMENT\]\";/public static readonly string CommitHash = \"${{ steps.metadata.outputs.COMMIT_HASH }}\";/" CaddyManager/Configurations/Application/ApplicationInfo.cs
|
|
- name: Publish container
|
|
uses: nick-fields/retry@v3
|
|
with:
|
|
timeout_minutes: 10
|
|
max_attempts: 3
|
|
command: |
|
|
dotnet publish \
|
|
--configuration Release --os linux --arch x64 \
|
|
/t:PublishContainer -p ContainerRegistry=${{ vars.DOCKER_GITEA_DOMAIN }} \
|
|
-p ContainerRepository=ebolo/caddy-manager -p:ContainerImageTags='"${{ steps.metadata.outputs.APP_VERSION }};latest"'
|