Skip to content

Build triggered by @selfdocumentingcode on feature/update-openai-api #65

Build triggered by @selfdocumentingcode on feature/update-openai-api

Build triggered by @selfdocumentingcode on feature/update-openai-api #65

Workflow file for this run

name: Build
run-name: >-
${{ github.event_name == 'workflow_dispatch' &&
format ('Build triggered by @{0} on {1}', github.actor, github.ref_name)
|| null }}
on:
push:
branches:
- main
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
name: Build
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Test
run: dotnet test
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5.5.1
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
# set latest tag for default branch
type=raw,value=latest,enable={{is_default_branch}}
type=ref,event=branch,enable=${{ github.ref != format('refs/heads/{0}', 'main') }}
- name: Build and push Docker image
uses: docker/build-push-action@v5.1.0
with:
context: .
file: ./docker/Prod.Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}