mirror of
https://github.com/storytold/autocraft.git
synced 2026-11-28 00:59:43 +01:00
70 lines
2.5 KiB
YAML
70 lines
2.5 KiB
YAML
name: Docker publish
|
|
|
|
# Publishes the image the cluster's `autocraft` Deployment runs. The build lives
|
|
# in the shared reusable workflow, so this repo only owns the triggers, the image
|
|
# names and the layer cache.
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
tags: ["v*"]
|
|
workflow_dispatch:
|
|
inputs:
|
|
image:
|
|
description: Image to build
|
|
type: choice
|
|
options: [app, rust-stable]
|
|
default: app
|
|
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
concurrency:
|
|
group: docker-publish-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
# One image per run: the shared workflow names its digest artifacts per
|
|
# platform, so two image builds in one run would mix up their digests.
|
|
publish:
|
|
if: github.event_name != 'workflow_dispatch' || inputs.image == 'app'
|
|
uses: storytold/craft-common-actions/.github/workflows/docker-build.yml@0bef64f155fcea81edbd9542381777358bfbdcf4
|
|
secrets:
|
|
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
with:
|
|
images: |
|
|
ghcr.io/storytold/autocraft
|
|
docker.io/storytold/autocraft
|
|
dockerfile: deploy/container/Dockerfile
|
|
# The image is based on dhi.io/node, which needs a Docker Hub login.
|
|
dhi-login: true
|
|
# The dashboard shows this commit on its prompts page; there is no .git in
|
|
# the image.
|
|
build-args: |
|
|
SOURCE_COMMIT=${{ github.sha }}
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|
|
timeout-minutes: 45
|
|
|
|
# Toolchain image for build pods (docs/operations.md "Build pods"), pushed as
|
|
# docker.io/storytold/autocraft:rust-stable so the cluster pulls it with the
|
|
# same pull secret. Register its digest with `envs add --toolchain-image`.
|
|
# Built by a manual run with image=rust-stable.
|
|
rust-stable:
|
|
if: github.event_name == 'workflow_dispatch' && inputs.image == 'rust-stable'
|
|
uses: storytold/craft-common-actions/.github/workflows/docker-build.yml@0bef64f155fcea81edbd9542381777358bfbdcf4
|
|
secrets:
|
|
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
with:
|
|
images: |
|
|
docker.io/storytold/autocraft
|
|
dockerfile: deploy/container/Containerfile.rust-stable
|
|
context: deploy/container
|
|
tags: |
|
|
type=raw,value=rust-stable,enable=${{ github.ref_name == github.event.repository.default_branch }}
|
|
cache-from: type=gha,scope=rust-stable
|
|
cache-to: type=gha,scope=rust-stable,mode=max
|
|
timeout-minutes: 60
|