Skip to content

.NET 9 and Aspire orchestration #14

.NET 9 and Aspire orchestration

.NET 9 and Aspire orchestration #14

Workflow file for this run

name: Create Images
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
REGISTRY: ghcr.io
OWNER: ${{ github.repository_owner }}
API_IMAGE: openwish-api
WEB_IMAGE: openwish-web
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Generate Docker metadata for API
id: meta-api
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.API_IMAGE }}
tags: |
type=semver,pattern={{version}}
type=sha,format=short
type=ref,event=branch
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push API image
uses: docker/build-push-action@v5
with:
context: ./src
file: ./src/OpenWish.Api/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta-api.outputs.tags }}
labels: ${{ steps.meta-api.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Generate Docker metadata for Web
id: meta-web
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.WEB_IMAGE }}
tags: |
type=semver,pattern={{version}}
type=sha,format=short
type=ref,event=branch
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push Web image
uses: docker/build-push-action@v5
with:
context: ./src
file: ./src/OpenWish.Web/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta-web.outputs.tags }}
labels: ${{ steps.meta-web.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max