Selector/.gitea/workflows/ci.yml

92 lines
2.4 KiB
YAML
Raw Normal View History

2024-07-19 17:16:17 +01:00
name: ci
on: [push]
jobs:
build:
runs-on: ubuntu-latest
name: Build & Unit Test
strategy:
fail-fast: false
matrix:
dotnet-version: [ '8.0.x' ]
steps:
2024-07-19 17:27:09 +01:00
- uses: actions/checkout@v4
2024-07-19 17:19:59 +01:00
with:
2024-07-19 18:13:12 +01:00
github-server-url: https://gitea.sheep-ghoul.ts.net
2024-07-19 17:16:17 +01:00
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v3.0.3
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Install Dependencies
run: dotnet restore Selector.Core.sln
- name: Build
run: dotnet build --configuration Debug --no-restore Selector.Core.sln
- name: Test
run: dotnet test --no-restore --verbosity normal Selector.Core.sln
build-Docker:
runs-on: ubuntu-latest
name: Build Containers
needs: [build, build-Js] # for ignoring bad builds
2024-07-19 17:24:26 +01:00
if: gitea.event_name == 'push' && (gitea.ref == 'refs/heads/master' || startsWith(gitea.ref, 'refs/tags/'))
2024-07-19 17:16:17 +01:00
steps:
2024-07-19 17:27:09 +01:00
- uses: actions/checkout@v4
2024-07-19 17:19:59 +01:00
with:
2024-07-19 18:13:12 +01:00
github-server-url: https://gitea.sheep-ghoul.ts.net
2024-07-19 17:16:17 +01:00
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
2024-07-19 18:19:27 +01:00
registry: gitea.sheep-ghoul.ts.net
2024-07-19 17:16:17 +01:00
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build CLI Container
uses: docker/build-push-action@v5
with:
push: true
2024-07-19 18:19:27 +01:00
tags: sarsoo/selector-cli:latest
2024-07-19 17:16:17 +01:00
file: Dockerfile.CLI
- name: Build Web Container
uses: docker/build-push-action@v5
with:
push: true
2024-07-19 18:19:27 +01:00
tags: sarsoo/selector-web:latest
2024-07-19 17:16:17 +01:00
file: Dockerfile.Web
build-Js:
runs-on: ubuntu-latest
name: Build Frontend
strategy:
fail-fast: false
matrix:
node: [21]
steps:
2024-07-19 17:27:09 +01:00
- uses: actions/checkout@v4
2024-07-19 17:19:59 +01:00
with:
2024-07-19 18:13:12 +01:00
github-server-url: https://gitea.sheep-ghoul.ts.net
2024-07-19 17:16:17 +01:00
- name: Install Node ${{ matrix.node }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- name: Install Node Packages
working-directory: ./Selector.Web
run: npm ci
- name: Compile Front-end
working-directory: ./Selector.Web
run: npm run build --if-present