Skip to content

fix(anubis cd): specify version for cargo nextest #2

fix(anubis cd): specify version for cargo nextest

fix(anubis cd): specify version for cargo nextest #2

name: Enki - Build Docker image and publish to GitHub Packages
on:
push:
tags:
- "v*.*.*"
# branches:
# - develop
paths:
- "enki-problems/**"
- ".github/workflows/enki-problems-cd.yaml"
# pull_request:
# branches:
# - develop
#
# paths:
# - "enki-problems/**"
# - ".github/workflows/enki-problems-cd.yaml"
env:
REGISTRY: ghcr.io
IMAGE_NAME: enki-problems
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: enki-problems
steps:
- uses: actions/checkout@v4
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: '7.0.x'
- name: Build
run: |
dotnet restore "src/EnkiProblems.HttpApi.Host/EnkiProblems.HttpApi.Host.csproj"
dotnet restore "test/EnkiProblems.Application.Tests/EnkiProblems.Application.Tests.csproj"
dotnet build --no-restore
- name: Test
run: dotnet test -e DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{version}}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: enki-problems
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}