Skip to content

replace IClock with TimeProvider #10

replace IClock with TimeProvider

replace IClock with TimeProvider #10

name: Publish Docker Images
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: read
packages: write
concurrency:
group: publish-docker-images-${{ github.ref }}
cancel-in-progress: true
env:
REGISTRY: ghcr.io
jobs:
publish:
name: Publish ${{ matrix.image.name }} image
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
image:
- name: web
dockerfile: src/StatusPageSharp.Web/Dockerfile
- name: worker
dockerfile: src/StatusPageSharp.Worker/Dockerfile
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Log in to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Generate Docker metadata
id: metadata
uses: docker/metadata-action@v6
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}-${{ matrix.image.name }}
tags: |
type=raw,value=main
type=sha
- name: Build and push Docker image
uses: docker/build-push-action@v7
with:
context: .
file: ${{ matrix.image.dockerfile }}
push: true
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
cache-from: type=gha,scope=${{ matrix.image.name }}
cache-to: type=gha,mode=max,scope=${{ matrix.image.name }}