Files
news/.gitea/workflows/release.yml
T
connor 43b94489f5
Check / guardrails (push) Successful in 1m43s
Check / bundle (push) Successful in 1m15s
Check / check (push) Successful in 2m42s
Image / image (push) Failing after 20s
v0.2 wave 1: merge-rule-v2 clustering with LLM-candidate gray zone, 0.2.0 version plumbing, deploy verification docs
2026-09-03 16:46:12 -04:00

58 lines
2.1 KiB
YAML

# Builds the image and pushes it. It does not deploy.
#
# What picks it up is a timer on the server (see `deploy/`), so nothing here
# holds a credential for the machine it runs on and a bad build cannot take the
# service down by itself. The trade is that a deploy happens a few minutes
# after the push rather than at the moment of it.
name: Image
on:
push:
branches:
- main
tags:
- 'v*'
jobs:
image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Compute short sha
id: short
run: echo "sha=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ${{ vars.REGISTRY }}
username: ${{ vars.USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
# Tagged with the commit as well as `latest`, so that "what is actually
# running" has an answer, and so a rollback is a tag rather than a revert
# and a rebuild. On a `v*` tag build the tag name is added too, so an
# exact version can be pinned; on branch pushes that expression is empty
# and the line is dropped. The version build-arg/label follow the same
# rule and feed /api/version through the Dockerfile's ARGs.
- uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
build-args: |
NEWS_BUILD_VERSION=${{ github.ref_type == 'tag' && github.ref_name || 'dev' }}
NEWS_BUILD_SHA=${{ github.sha }}
labels: |
org.opencontainers.image.version=${{ github.ref_type == 'tag' && github.ref_name || 'dev' }}
org.opencontainers.image.revision=${{ github.sha }}
tags: |
${{ vars.REGISTRY }}/connor/news:latest
${{ vars.REGISTRY }}/connor/news:${{ steps.short.outputs.sha }}
${{ vars.REGISTRY }}/connor/news:${{ github.ref_type == 'tag' && github.ref_name || '' }}
cache-from: type=gha
cache-to: type=gha,mode=max