mirror of
https://github.com/OpenStaticFish/MicroServices.git
synced 2026-10-12 22:25:14 +00:00
Publish service images to GHCR
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
name: Publish Images
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
IMAGE_PREFIX: openstaticfish/microservices
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
name: Build and Push ${{ matrix.service }}
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
service:
|
||||
- site-analyzer
|
||||
- scraper
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Log in to GHCR
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Build and push image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: ./services/${{ matrix.service }}
|
||||
push: true
|
||||
tags: |
|
||||
${{ env.REGISTRY }}/${{ env.IMAGE_PREFIX }}/${{ matrix.service }}:${{ github.sha }}
|
||||
${{ env.REGISTRY }}/${{ env.IMAGE_PREFIX }}/${{ matrix.service }}:main
|
||||
@@ -281,6 +281,21 @@ doppler run -- your-command
|
||||
|
||||
Tilt uses Doppler to create the local Kubernetes `webshare-api` secret for the scraper service. Do not commit local `.env` files; `.env` and `.env.*` are ignored by Git.
|
||||
|
||||
## Production Images
|
||||
|
||||
Tilt is local-development only in this repo. It continues to build local images named `site-analyzer` and `scraper` for the Kind/Tilt workflow.
|
||||
|
||||
Production deployment is owned by the HetznerTerra GitOps repo. This repo publishes container images only; it is not the source of truth for production Kubernetes deployment manifests.
|
||||
|
||||
On pushes to `main`, GitHub Actions builds and pushes these GHCR images:
|
||||
|
||||
- `ghcr.io/openstaticfish/microservices/site-analyzer:main`
|
||||
- `ghcr.io/openstaticfish/microservices/site-analyzer:<git-sha>`
|
||||
- `ghcr.io/openstaticfish/microservices/scraper:main`
|
||||
- `ghcr.io/openstaticfish/microservices/scraper:<git-sha>`
|
||||
|
||||
HetznerTerra should reference immutable `<git-sha>` tags for production deployments. Runtime secrets, including the scraper Webshare configuration, must be supplied by the deployment environment and are not baked into images.
|
||||
|
||||
## Layout
|
||||
|
||||
```text
|
||||
|
||||
Reference in New Issue
Block a user