Scorecard's next run surfaced two more specifics: - upload-sarif rejected results_file (old input name); the modern input is sarif_file — the default fell back to ../results and the step failed with 'Path does not exist'. Scorecard analysis itself ran fine; only the SARIF upload was misconfigured - GitHub deprecates CodeQL Action v3 in December 2026 — weeks away — and the runner logs flagged Node 20 on checkout/upload-artifact Everything moves to the newest major with Node 24: codeql-action v4, checkout v5, setup-python v6, upload-artifact v5, upload-pages-artifact v4, login-action v4, metadata-action v6, build-push-action v7 (deploy- pages v5 / configure-pages v6 / setup-buildx-action v4 stay: no newer major exists). All SHAs resolved from the Git refs API with annotated tags peeled to commits, verified via the commits endpoint.
79 lines
2.4 KiB
YAML
79 lines
2.4 KiB
YAML
name: Docker
|
|
|
|
# Publishes prebuilt images to GHCR so self-hosting skips the build step:
|
|
# ghcr.io/abolfazlrwm/sokhan-api (the FastAPI service; the Celery worker
|
|
# reuses this image with a command override)
|
|
# ghcr.io/abolfazlrwm/sokhan-web (the Next.js dashboard, standalone output)
|
|
# `latest` tracks main, version tags get semver tags, every build gets a
|
|
# `sha-<short>` tag for pinning.
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
tags: ["v*"]
|
|
paths-ignore:
|
|
- "**.md"
|
|
- "docs/**"
|
|
- "benchmarks/**"
|
|
- "training/**"
|
|
- "space/**"
|
|
- "bot/**"
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
env:
|
|
# GHCR image names are lowercase; the repo owner is "Abolfazlrwm".
|
|
IMAGE_PREFIX: ghcr.io/abolfazlrwm
|
|
|
|
jobs:
|
|
publish:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 40
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- image: sokhan-api
|
|
context: ./backend
|
|
- image: sokhan-web
|
|
context: ./web
|
|
steps:
|
|
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4
|
|
|
|
- name: Log in to GHCR
|
|
uses: docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550 # v4
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Derive image tags
|
|
id: meta
|
|
uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 # v6
|
|
with:
|
|
images: ${{ env.IMAGE_PREFIX }}/${{ matrix.image }}
|
|
tags: |
|
|
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
|
|
type=semver,pattern={{version}}
|
|
type=sha,prefix=sha-
|
|
|
|
- name: Build and push ${{ matrix.image }}
|
|
uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7
|
|
with:
|
|
context: ${{ matrix.context }}
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
# Supply-chain: every image ships an SBOM and build provenance
|
|
# attestation, verifiable with `docker buildx imagetools inspect`.
|
|
provenance: mode=max
|
|
sbom: true
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|