Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

feat(certificate-processing): add build pipeline via github action #499

Merged
merged 3 commits into from
Aug 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/certificate-processing.api.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: CertificateProcessing.API

on:
push:
paths:
- "src/Services/CertificateProcessing/**"
- ".github/workflows/certificate-processing.api.yml"
- "src/Libraries/OpenTelemetry/**"
- "build/dotnet/**"
- "src/Directory.Build.props"
- "docker-compose.yml"
- "docker-compose.override.yml"
- "docker-compose.dcproj"
- "docker-compose-test.yml"
- "docker-compose-test.override.yml"
pull_request:
paths:
- "src/Services/CertificateProcessing/**"
- ".github/workflows/certificate-processing.api.yml"
- "src/Libraries/OpenTelemetry/**"
- "build/dotnet/**"
- "src/Directory.Build.props"
- "docker-compose.yml"
- "docker-compose.override.yml"
- "docker-compose.dcproj"
- "docker-compose-test.yml"
- "docker-compose-test.override.yml"

jobs:
build:
runs-on: ubuntu-16.04

steps:
- uses: actions/checkout@v1

- name: set image tag
run: echo "TAG=$(git tag --points-at HEAD | cut -c 2-4)" >> $GITHUB_ENV

- name: build
run: docker-compose build certificateprocessing.api

- uses: azure/docker-login@v1
if: startsWith(github.ref, 'refs/tags') || github.ref == 'refs/heads/master'
with:
login-server: index.docker.io
username: ${{ secrets.DOCKERIO_USERNAME }}
password: ${{ secrets.DOCKERIO_PASSWORD }}

- name: push image
if: startsWith(github.ref, 'refs/tags') || github.ref == 'refs/heads/master'
run: docker-compose push certificateprocessing.api
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Serilog" Version="2.10.0" />
<PackageReference Include="Serilog.Enrichers.Span" Version="1.3.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.1.4" />
<!-- Swagger -->
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.1.5"/>
<!-- Logging -->
<PackageReference Include="Serilog.AspNetCore" Version="4.1.0"/>
<PackageReference Include="Serilog.Enrichers.Span" Version="1.3.0"/>
<PackageReference Include="Serilog.Sinks.Seq" Version="5.0.1"/>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
using System;
using System.Diagnostics;
using System.IO;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Serilog;
using Serilog.Enrichers.Span;

namespace CertificateProcessing.API
{
public class Program
public static class Program
{
public static readonly string Namespace = typeof(Program).Namespace!;
public static readonly string AppName = Namespace.Substring(Namespace.LastIndexOf('.', Namespace.LastIndexOf('.') - 1) + 1);
public static readonly string AppName = Namespace[(Namespace.LastIndexOf('.', Namespace.LastIndexOf('.') - 1) + 1)..];

[System.Diagnostics.CodeAnalysis.SuppressMessage(
"Design",
"CA1031:Do not catch general exception types",
Justification = "Top level all exception catcher")]
public static int Main(string[] args)
{
Activity.DefaultIdFormat = ActivityIdFormat.W3C;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Microsoft.OpenApi.Models;
using Serilog;

Expand Down