Initial STEP 3 study game and questions API

This commit is contained in:
hz
2026-07-09 20:50:33 -05:00
commit 277076a245
51 changed files with 2671 additions and 0 deletions
+65
View File
@@ -0,0 +1,65 @@
name: Questions API
on:
push:
branches: [main]
paths:
- "api/QuestionsApi/**"
- ".github/workflows/questions-api.yml"
pull_request:
paths:
- "api/QuestionsApi/**"
- ".github/workflows/questions-api.yml"
env:
DOTNET_VERSION: "8.0.x"
IMAGE_NAME: ghcr.io/${{ github.repository }}/questions-api
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Restore
run: dotnet restore api/QuestionsApi/QuestionsApi.csproj
- name: Build
run: dotnet build api/QuestionsApi/QuestionsApi.csproj --configuration Release --no-restore
- name: Publish
run: dotnet publish api/QuestionsApi/QuestionsApi.csproj --configuration Release --no-build --output publish/questions-api
- name: Upload publish artifact
uses: actions/upload-artifact@v4
with:
name: questions-api-publish
path: publish/questions-api
- name: Log in to GitHub Container Registry
if: github.event_name == 'push'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
if: github.event_name == 'push'
uses: docker/build-push-action@v6
with:
context: api/QuestionsApi
push: true
tags: |
${{ env.IMAGE_NAME }}:${{ github.sha }}
${{ env.IMAGE_NAME }}:latest