Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 31 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
name: Versioned images
name: Publish images
on:
push:
branches: [main]
tags: ['v*.*.*']
workflow_dispatch:
permissions:
contents: read
concurrency:
group: publish-${{ github.sha }}
cancel-in-progress: false
jobs:
verify:
uses: ./.github/workflows/ci.yml
Expand All @@ -25,21 +30,42 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Image tags
id: tags
env:
IMAGE: ghcr.io/${{ github.repository }}-${{ matrix.target }}
shell: bash
run: |
image="${IMAGE,,}"
echo "image=$image" >> "$GITHUB_OUTPUT"
{
echo 'tags<<EOF'
echo "$image:sha-$GITHUB_SHA"
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
echo "$image:$GITHUB_REF_NAME"
fi
echo EOF
} >> "$GITHUB_OUTPUT"
- uses: docker/build-push-action@v6
id: build
with:
context: .
file: infrastructure/docker/Dockerfile
target: ${{ matrix.target }}
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/stephanterning/tendly-${{ matrix.target }}:${{ github.ref_name }}
ghcr.io/stephanterning/tendly-${{ matrix.target }}:sha-${{ github.sha }}
tags: ${{ steps.tags.outputs.tags }}
labels: |
org.opencontainers.image.source=https://github.com/stephanterning/tendly
org.opencontainers.image.source=https://github.com/${{ github.repository }}
org.opencontainers.image.licenses=AGPL-3.0-or-later
org.opencontainers.image.revision=${{ github.sha }}
- name: Record published digest
env:
IMAGE: ${{ steps.tags.outputs.image }}
DIGEST: ${{ steps.build.outputs.digest }}
run: printf 'Image `%s@%s` (commit `%s`)\n' "$IMAGE" "$DIGEST" "$GITHUB_SHA" >> "$GITHUB_STEP_SUMMARY"
release:
if: startsWith(github.ref, 'refs/tags/')
needs: images
runs-on: ubuntu-latest
permissions:
Expand Down
16 changes: 12 additions & 4 deletions docs/operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,20 @@ CI/development installations.
## Upgrades and release images

CI validates contracts, lint/types/build, focused tests, real PostgreSQL migrations,
and Compose build/restart checks. Version tags `vX.Y.Z` run these checks again before
publishing amd64/arm64 API/worker/web images to GHCR. No release images have been
published by Stage 1. Never reuse a released tag; record image digests in release notes.
and Compose build/restart checks. The Publish images workflow runs these checks
before publishing amd64/arm64
API/worker/web images to GHCR on main pushes, version tags `vX.Y.Z`, or manual
workflow runs. Every build publishes `sha-<full commit SHA>` tags; version-tag
builds also publish their version and create a GitHub release. All three images
must use the same source revision. Publishing never triggers a server deployment.
Confirm all three images finished publishing before deploying, and pin their
individual digests for reproducible deployments. Package visibility must be public
for installations to pull without registry credentials. Never reuse a released tag;
record image digests in release notes.
Registry owners should restrict package/tag overwrite permissions.

For a future published version, set TENDLY_VERSION to its full tag, pull the images,
For a published version, set TENDLY_VERSION to its full version or `sha-<SHA>` tag,
pull the images,
and run Compose without building. There are no automatic upgrades. Before upgrading,
back up the database, attachment files and required secrets. Recreate the one-shot
migration service for each deployment so a previous exited container is not mistaken
Expand Down
Loading