Skip to content

map extensions

map extensions #66

Workflow file for this run

name: .NET
on:
push:
branches: [ master ]
workflow_dispatch:
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
services:
postgres:
image: docker.io/postgres:16
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.PAT }}
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Add Github Packages NuGet feed
run: >
dotnet nuget add source
--username $GITHUB_REPOSITORY_OWNER
--password ${{ secrets.PAT }}
--store-password-in-clear-text
--name github
"https://nuget.pkg.github.com/$GITHUB_REPOSITORY_OWNER/index.json"
- name: Restore dependencies
run: dotnet restore -r linux-x64
- name: Test
run: dotnet test --no-restore -c Release -r linux-x64 -v minimal --logger "console;verbosity=detailed"
env:
Db__ConnectionString: "Host=localhost;Port=5432;Database=battletrace_tests;Username=postgres;Password=postgres;Include Error Detail=true;Command Timeout=60"
- name: Publish
run: >
dotnet publish BattleTrace
--no-restore -c Release -r linux-x64 --self-contained false -o bin/publish/
-p:GenerateDocumentationFile=false
-p:PublishSingleFile=true
-p:DebugType=None
- name: SSH Config
working-directory: .github/workflows
run: bash ssh-config.sh
env:
host: ${{ secrets.host }}
port: ${{ vars.port }}
key: ${{ secrets.SSH_KEY }}
- name: Upload
run: rsync -avzh --chown=$user:$user bin/publish target:/opt/battletrace/bin
- name: Deploy
working-directory: .github/workflows
run: ssh target 'cd /opt/battletrace/ && bash -s' < deploy.sh
env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION: true
TERM: xterm
user: ${{ vars.user }}