Skip to content
Open
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: 36 additions & 0 deletions .github/workflows/actionlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Lint workflows

on:
push:
branches: [ main, dev ]
paths:
- .github/workflows/**
pull_request:
branches: [ main, dev ]
paths:
- .github/workflows/**
workflow_dispatch:

permissions:
contents: read

jobs:
actionlint:
runs-on: ubuntu-latest
env:
ACTIONLINT_VERSION: '1.7.12'

steps:
- name: Checkout code
uses: actions/checkout@v4

# Script and binary are both pinned to the same release so a new
# actionlint version can't change the rules without a reviewed bump.
# shellcheck is preinstalled on the runner, so `run:` blocks are
# checked too.
- name: Download actionlint
id: get_actionlint
run: bash <(curl -fsSL "https://raw.githubusercontent.com/rhysd/actionlint/v${ACTIONLINT_VERSION}/scripts/download-actionlint.bash") "${ACTIONLINT_VERSION}"

- name: Run actionlint
run: ${{ steps.get_actionlint.outputs.executable }} -color
19 changes: 18 additions & 1 deletion .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,21 @@ name: Build and Push Docker Image

on:
push:
branches:
- main # Every merge to main publishes `latest` + `main-<sha>`
- dev # Every commit/merge on dev publishes `dev` + `dev-<sha>`
tags:
- 'v*' # Trigger on tags that start with 'v'
release:
types: [published]

# Serialise builds per ref so an older dev build can never finish last and
# overwrite a moving tag (`dev`/`latest`) with stale code. Superseded branch
# builds are cancelled; tag/release builds always run to completion.
concurrency:
group: docker-publish-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/heads/') }}

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
Expand Down Expand Up @@ -40,9 +50,16 @@ jobs:
# Pre-releases (PEP 440 a/b/rc/dev, e.g. v1.4.1rc1) get only their
# own tag, never `latest`: prod pulls `latest` via Watchtower, so an
# RC must not roll out on its own. contains() is case-insensitive.
# Merges to main also get `latest` (so they deploy via Watchtower)
# plus an immutable `main-<short sha>` tag for pinning/rollback.
# Pushes to dev get the moving `dev` tag plus `dev-<short sha>`, and
# never `latest`.
tags: |
type=ref,event=tag
type=raw,value=latest,enable=${{ !contains(github.ref_name, 'a') && !contains(github.ref_name, 'b') && !contains(github.ref_name, 'rc') && !contains(github.ref_name, 'dev') }}
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' || (startsWith(github.ref, 'refs/tags/') && !contains(github.ref_name, 'a') && !contains(github.ref_name, 'b') && !contains(github.ref_name, 'rc') && !contains(github.ref_name, 'dev')) }}
type=sha,prefix=main-,format=short,enable=${{ github.ref == 'refs/heads/main' }}
type=raw,value=dev,enable=${{ github.ref == 'refs/heads/dev' }}
type=sha,prefix=dev-,format=short,enable=${{ github.ref == 'refs/heads/dev' }}

- name: Build and push Docker image
id: build
Expand Down
7 changes: 7 additions & 0 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ docker run --rm \

The application will be available at `http://localhost:5008`.

To try unreleased changes, use `ghcr.io/m-beau/pixelmap:dev` instead. It is
rebuilt on every commit to the `dev` branch, and each build is also pinned as
`dev-<short commit sha>` (e.g. `dev-697dbdd`).

`latest` tracks the `main` branch and is rebuilt on every merge to `main`;
each of those builds is also pinned as `main-<short commit sha>`.

:::{note}
On Apple Silicon (M1/M2) or ARM Linux, add `--platform linux/amd64` to the Docker command.
:::
Expand Down
Loading