1
0
mirror of https://github.com/XFox111/backbone.git synced 2026-04-22 07:17:59 +03:00

chore(dev): ci workflow update + minor changes

This commit is contained in:
2025-09-03 08:20:38 +00:00
parent 6984c63028
commit 5fe5aaf33b
4 changed files with 58 additions and 32 deletions
+41
View File
@@ -0,0 +1,41 @@
name: "Audit pipeline"
on:
push:
branches: [ "main", "next" ]
paths-ignore:
- '.devcontainer/*'
- '.github/*'
- '!.github/workflows/audit.yml'
- '.vscode/*'
- '**.md'
- 'Properties/launchSettings.json'
- 'appsettings*.json'
- 'LICENSE'
pull_request:
branches: [ "main", "next" ]
paths-ignore:
- '.devcontainer/*'
- '.github/*'
- '!.github/workflows/ci.yml'
- '.vscode/*'
- '**.md'
- 'Properties/launchSettings.json'
- 'appsettings*.json'
- 'LICENSE'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- uses: actions/checkout@v5
- uses: docker/build-push-action@v6
with:
context: .
tags: "backbone:ci"
+10 -31
View File
@@ -1,33 +1,9 @@
name: "CI pipeline" name: "CI pipeline"
on: on:
push: release:
branches: [ "main" ] types: [ published ]
paths-ignore:
- '.devcontainer/*'
- '.github/*'
- '!.github/workflows/ci.yml'
- '.vscode/*'
- '**.md'
- 'Properties/launchSettings.json'
- 'LICENSE'
pull_request:
branches: [ "main", "next" ]
paths-ignore:
- '.devcontainer/*'
- '.github/*'
- '!.github/workflows/ci.yml'
- '.vscode/*'
- '**.md'
- 'Properties/launchSettings.json'
- 'LICENSE'
workflow_dispatch: workflow_dispatch:
inputs:
push:
type: boolean
required: false
default: false
description: "Push to Docker Hub"
jobs: jobs:
build: build:
@@ -37,7 +13,12 @@ jobs:
packages: write packages: write
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v5
- name: Update assembly version
if: startsWith(github.ref, 'refs/tags/')
run: |
sed -i 's|AssemblyVersion("1.0.0.0")|AssemblyVersion("${{ github.ref_name }}")|' Program.cs
- uses: docker/metadata-action@v5 - uses: docker/metadata-action@v5
id: meta id: meta
@@ -47,17 +28,15 @@ jobs:
ghcr.io/${{ github.repository }} ghcr.io/${{ github.repository }}
tags: | tags: |
latest latest
${{ github.sha }} ${{ github.ref_name }}
- name: "Login to Docker Hub" - name: "Login to Docker Hub"
if: github.event_name != 'pull_request' || github.event.inputs.push == 'true'
uses: docker/login-action@v3 uses: docker/login-action@v3
with: with:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: "Login to GitHub Container Registry" - name: "Login to GitHub Container Registry"
if: github.event_name != 'pull_request' || github.event.inputs.push == 'true'
uses: docker/login-action@v3 uses: docker/login-action@v3
with: with:
registry: ghcr.io registry: ghcr.io
@@ -67,5 +46,5 @@ jobs:
- uses: docker/build-push-action@v6 - uses: docker/build-push-action@v6
with: with:
context: . context: .
push: ${{ github.event_name != 'pull_request' || github.event.inputs.push == 'true' }} push: true
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
+2 -1
View File
@@ -17,4 +17,5 @@ COPY --from=build /out/Backbone .
COPY --from=build /out/appsettings*.json . COPY --from=build /out/appsettings*.json .
EXPOSE 80 EXPOSE 80
ENTRYPOINT [ "./Backbone", "--urls", "http://*:80" ] ENTRYPOINT [ "./Backbone" ]
CMD [ "--urls", "http://*:80" ]
+5
View File
@@ -1,7 +1,12 @@
using System.Reflection;
using System.Text.Json.Serialization; using System.Text.Json.Serialization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.SignalR; using Microsoft.AspNetCore.SignalR;
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyCompany("Eugene Fox")]
[assembly: AssemblyCopyright("© Eugene Fox 2025")]
WebApplicationBuilder builder = WebApplication.CreateSlimBuilder(args); WebApplicationBuilder builder = WebApplication.CreateSlimBuilder(args);
builder.Services.AddSignalR(); builder.Services.AddSignalR();