food-market/.github/workflows/docker.yml
nurdotnet 5dce324f24 ci: move Linux jobs (backend, web, docker api/web) to self-hosted runner
POS stays on windows-latest (tag/manual only). Runner is registered on
the stage server, systemd-managed, labels [self-hosted, Linux, X64].
Goal: drop dependency on the 2000 GitHub-hosted minute quota — Windows
POS build now runs at most once per release tag.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-22 23:17:52 +05:00

73 lines
1.8 KiB
YAML

name: Docker Images
on:
push:
branches: [main]
paths:
- 'src/food-market.api/**'
- 'src/food-market.web/**'
- 'src/food-market.application/**'
- 'src/food-market.domain/**'
- 'src/food-market.infrastructure/**'
- 'src/food-market.shared/**'
- 'deploy/**'
- '.github/workflows/docker.yml'
workflow_dispatch:
permissions:
contents: read
packages: write
jobs:
api:
name: API image
runs-on: [self-hosted, linux]
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build + push
uses: docker/build-push-action@v6
with:
context: .
file: deploy/Dockerfile.api
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/food-market-api:latest
ghcr.io/${{ github.repository_owner }}/food-market-api:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
web:
name: Web image
runs-on: [self-hosted, linux]
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build + push
uses: docker/build-push-action@v6
with:
context: .
file: deploy/Dockerfile.web
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/food-market-web:latest
ghcr.io/${{ github.repository_owner }}/food-market-web:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max