52 lines
1.4 KiB
YAML
52 lines
1.4 KiB
YAML
name: CI
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches: [main]
|
|
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
jobs:
|
|
build-test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-dotnet@v4
|
|
with:
|
|
dotnet-version: 10.0.x
|
|
- run: dotnet restore IpCheck.slnx
|
|
- run: dotnet build IpCheck.slnx -c Release --no-restore
|
|
- run: dotnet run --project tests/IpCheck.UnitTests/IpCheck.UnitTests.fsproj -c Release --no-build
|
|
- run: docker compose -f deploy/docker-compose.yml config
|
|
env:
|
|
POSTGRES_PASSWORD: ci-only
|
|
IPCHECK_LOCATION_ID: 11111111-1111-1111-1111-111111111111
|
|
|
|
containers:
|
|
if: github.event_name == 'push'
|
|
needs: build-test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: docker/setup-buildx-action@v3
|
|
- uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
- uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
file: Dockerfile.server
|
|
push: true
|
|
tags: ghcr.io/${{ github.repository_owner }}/ipcheck-server:${{ github.sha }}
|
|
- uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
file: Dockerfile.agent
|
|
push: true
|
|
tags: ghcr.io/${{ github.repository_owner }}/ipcheck-agent:${{ github.sha }}
|