Skip to content

Commit 2c30729

Browse files
committed
initial commit
0 parents  commit 2c30729

21 files changed

Lines changed: 1157 additions & 0 deletions

.dockerignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.github/
2+
bin/
3+
obj/
4+
Deployment/
5+
.dockerignore
6+
Dockerfile
7+
.env*
8+
LICENSE
9+
README.md
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Docker Publish AdminBot
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
tags: ["v*.*.*"]
7+
pull_request:
8+
branches: ["main"]
9+
10+
env:
11+
REGISTRY: ghcr.io
12+
IMAGE_NAME: ttxdev/ttx.adminbot
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: read
19+
packages: write
20+
id-token: write
21+
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v4
25+
26+
- name: Set up Docker Buildx
27+
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226
28+
29+
- name: Log into registry ${{ env.REGISTRY }}
30+
if: github.event_name != 'pull_request'
31+
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d
32+
with:
33+
registry: ${{ env.REGISTRY }}
34+
username: ${{ github.actor }}
35+
password: ${{ secrets.GITHUB_TOKEN }}
36+
37+
- name: Extract Docker metadata
38+
id: meta
39+
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934
40+
with:
41+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
42+
tags: |
43+
type=ref,event=branch
44+
type=ref,event=pr
45+
type=semver,pattern={{version}}
46+
type=sha
47+
48+
- name: Build and push Docker image
49+
id: build-and-push
50+
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09
51+
with:
52+
context: .
53+
push: ${{ github.event_name != 'pull_request' }}
54+
tags: ${{ steps.meta.outputs.tags }}
55+
labels: ${{ steps.meta.outputs.labels }}
56+
cache-from: type=gha
57+
cache-to: type=gha,mode=max

.github/workflows/dotnet.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# This workflow will build a .NET project
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
3+
4+
name: .NET
5+
6+
on:
7+
push:
8+
branches: ["main"]
9+
pull_request:
10+
branches: ["main"]
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: Setup .NET
19+
uses: actions/setup-dotnet@v4
20+
with:
21+
dotnet-version: 10.0.x
22+
- name: Restore dependencies
23+
run: dotnet restore
24+
- name: Build
25+
run: dotnet build --no-restore
26+
27+
test:
28+
runs-on: ubuntu-latest
29+
services:
30+
postgres:
31+
image: timescale/timescaledb:latest-pg17
32+
ports:
33+
- 5432:5432
34+
env:
35+
POSTGRES_PASSWORD: postgres
36+
POSTGRES_DB: ttx_test
37+
options: >-
38+
--health-cmd pg_isready
39+
--health-interval 10s
40+
--health-timeout 5s
41+
--health-retries 5
42+
redis:
43+
image: redis:latest
44+
ports:
45+
- 6379:6379
46+
options: >-
47+
--health-cmd "redis-cli ping"
48+
--health-interval 10s
49+
--health-timeout 5s
50+
--health-retries 5
51+
52+
steps:
53+
- uses: actions/checkout@v4
54+
- name: Setup .NET
55+
uses: actions/setup-dotnet@v4
56+
with:
57+
dotnet-version: 10.0.x
58+
- name: Restore dependencies
59+
run: dotnet restore
60+
- name: Test
61+
env:
62+
TTX__Infrastructure__ConnectionStrings__Postgres: "Server=localhost;Port=5432;Database=ttx_test;Username=postgres;Password=postgres;"
63+
TTX__Infrastructure__ConnectionStrings__Redis: "localhost:6379"
64+
TTX__Infrastructure__Events: "Redis"
65+
TTX__Infrastructure__Data: "Postgres"
66+
run: dotnet test --verbosity normal

0 commit comments

Comments
 (0)