This commit is contained in:
Chris Rose 2026-03-27 09:20:02 +00:00 committed by GitHub
commit 5a6f74ec8c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 181 additions and 22 deletions

View File

@ -21,15 +21,58 @@ jobs:
outputs:
prerelease: ${{ steps.version_vars.outputs.mastodon_version_prerelease }}
compute-prefix:
runs-on: ubuntu-latest
steps:
- id: repository_vars
env:
config_mastodon_image_name: ${{ vars.MASTODON_IMAGE_NAME }}
config_mastodon_streaming_image_name: ${{ vars.MASTODON_STREAMING_IMAGE_NAME }}
run: |
# If custom image names are configured, use them; otherwise, default to both
# Docker Hub (tootsuite) and GitHub Container Registry (ghcr.io) for wider distribution
if [ -n "$config_mastodon_image_name" ]; then
{
echo 'image_name<<EOF'
echo "$config_mastodon_image_name"
echo 'EOF'
} >> "$GITHUB_OUTPUT"
else
{
echo 'image_name<<EOF'
echo 'tootsuite/mastodon'
echo 'ghcr.io/mastodon/mastodon'
echo 'EOF'
} >> "$GITHUB_OUTPUT"
fi
if [ -n "$config_mastodon_streaming_image_name" ]; then
{
echo 'streaming_image_name<<EOF'
echo "$config_mastodon_streaming_image_name"
echo 'EOF'
} >> "$GITHUB_OUTPUT"
else
{
echo 'streaming_image_name<<EOF'
echo 'tootsuite/mastodon-streaming'
echo 'ghcr.io/mastodon/mastodon-streaming'
echo 'EOF'
} >> "$GITHUB_OUTPUT"
fi
outputs:
image_name: ${{ steps.repository_vars.outputs.image_name }}
streaming_image_name: ${{ steps.repository_vars.outputs.streaming_image_name }}
build-image:
needs: compute-suffix
needs: [compute-suffix, compute-prefix]
uses: ./.github/workflows/build-container-image.yml
with:
file_to_build: Dockerfile
cache: false
push_to_images: |
tootsuite/mastodon
ghcr.io/mastodon/mastodon
${{ needs.compute-prefix.outputs.image_name }}
version_prerelease: ${{ needs.compute-suffix.outputs.prerelease }}
labels: |
org.opencontainers.image.description=Nightly build image used for testing purposes
@ -42,14 +85,13 @@ jobs:
secrets: inherit
build-image-streaming:
needs: compute-suffix
needs: [compute-suffix, compute-prefix]
uses: ./.github/workflows/build-container-image.yml
with:
file_to_build: streaming/Dockerfile
cache: false
push_to_images: |
tootsuite/mastodon-streaming
ghcr.io/mastodon/mastodon-streaming
${{ needs.compute-prefix.outputs.streaming_image_name }}
version_prerelease: ${{ needs.compute-suffix.outputs.prerelease }}
labels: |
org.opencontainers.image.description=Nightly build image used for testing purposes

View File

@ -27,13 +27,46 @@ jobs:
metadata: ${{ steps.version_vars.outputs.mastodon_version_metadata }}
short_sha: ${{ steps.version_vars.outputs.mastodon_short_sha }}
compute-prefix:
runs-on: ubuntu-latest
steps:
- id: repository_vars
env:
config_mastodon_image_name: ${{ vars.MASTODON_IMAGE_NAME }}
config_mastodon_streaming_image_name: ${{ vars.MASTODON_STREAMING_IMAGE_NAME }}
run: |
# Compute image names, supporting multi-line values for custom configurations
if [ -n "$config_mastodon_image_name" ]; then
{
echo 'image_name<<EOF'
echo "$config_mastodon_image_name"
echo 'EOF'
} >> "$GITHUB_OUTPUT"
else
echo "image_name=ghcr.io/mastodon/mastodon" >> "$GITHUB_OUTPUT"
fi
if [ -n "$config_mastodon_streaming_image_name" ]; then
{
echo 'streaming_image_name<<EOF'
echo "$config_mastodon_streaming_image_name"
echo 'EOF'
} >> "$GITHUB_OUTPUT"
else
echo "streaming_image_name=ghcr.io/mastodon/mastodon-streaming" >> "$GITHUB_OUTPUT"
fi
outputs:
image_name: ${{ steps.repository_vars.outputs.image_name }}
streaming_image_name: ${{ steps.repository_vars.outputs.streaming_image_name }}
build-image:
needs: compute-suffix
needs: [compute-suffix, compute-prefix]
uses: ./.github/workflows/build-container-image.yml
with:
file_to_build: Dockerfile
push_to_images: |
ghcr.io/mastodon/mastodon
${{ needs.compute-prefix.outputs.image_name }}
version_metadata: ${{ needs.compute-suffix.outputs.metadata }}
flavor: |
latest=auto
@ -43,12 +76,12 @@ jobs:
secrets: inherit
build-image-streaming:
needs: compute-suffix
needs: [compute-suffix, compute-prefix]
uses: ./.github/workflows/build-container-image.yml
with:
file_to_build: streaming/Dockerfile
push_to_images: |
ghcr.io/mastodon/mastodon-streaming
${{ needs.compute-prefix.outputs.streaming_image_name }}
version_metadata: ${{ needs.compute-suffix.outputs.metadata }}
flavor: |
latest=auto

View File

@ -45,14 +45,57 @@ jobs:
echo "is_latest_stable=false" >> "$GITHUB_OUTPUT"
fi
compute-prefix:
runs-on: ubuntu-latest
steps:
- id: repository_vars
env:
config_mastodon_image_name: ${{ vars.MASTODON_IMAGE_NAME }}
config_mastodon_streaming_image_name: ${{ vars.MASTODON_STREAMING_IMAGE_NAME }}
run: |
# If custom image names are configured, use them; otherwise, default to both
# Docker Hub (tootsuite) and GitHub Container Registry (ghcr.io) for wider distribution
if [ -n "$config_mastodon_image_name" ]; then
{
echo 'image_name<<EOF'
echo "$config_mastodon_image_name"
echo 'EOF'
} >> "$GITHUB_OUTPUT"
else
{
echo 'image_name<<EOF'
echo 'tootsuite/mastodon'
echo 'ghcr.io/mastodon/mastodon'
echo 'EOF'
} >> "$GITHUB_OUTPUT"
fi
if [ -n "$config_mastodon_streaming_image_name" ]; then
{
echo 'streaming_image_name<<EOF'
echo "$config_mastodon_streaming_image_name"
echo 'EOF'
} >> "$GITHUB_OUTPUT"
else
{
echo 'streaming_image_name<<EOF'
echo 'tootsuite/mastodon-streaming'
echo 'ghcr.io/mastodon/mastodon-streaming'
echo 'EOF'
} >> "$GITHUB_OUTPUT"
fi
outputs:
image_name: ${{ steps.repository_vars.outputs.image_name }}
streaming_image_name: ${{ steps.repository_vars.outputs.streaming_image_name }}
build-image:
needs: check-latest-stable
needs: [check-latest-stable, compute-prefix]
uses: ./.github/workflows/build-container-image.yml
with:
file_to_build: Dockerfile
push_to_images: |
tootsuite/mastodon
ghcr.io/mastodon/mastodon
${{ needs.compute-prefix.outputs.image_name }}
# Do not use cache when building releases, so apt update is always ran and the release always contain the latest packages
cache: false
# Only tag with latest when ran against the latest stable branch
@ -65,13 +108,12 @@ jobs:
secrets: inherit
build-image-streaming:
needs: check-latest-stable
needs: [check-latest-stable, compute-prefix]
uses: ./.github/workflows/build-container-image.yml
with:
file_to_build: streaming/Dockerfile
push_to_images: |
tootsuite/mastodon-streaming
ghcr.io/mastodon/mastodon-streaming
${{ needs.compute-prefix.outputs.streaming_image_name }}
# Do not use cache when building releases, so apt update is always ran and the release always contain the latest packages
cache: false
# Only tag with latest when ran against the latest stable branch

View File

@ -18,15 +18,58 @@ jobs:
outputs:
prerelease: ${{ steps.version_vars.outputs.mastodon_version_prerelease }}
compute-prefix:
runs-on: ubuntu-latest
steps:
- id: repository_vars
env:
config_mastodon_image_name: ${{ vars.MASTODON_IMAGE_NAME }}
config_mastodon_streaming_image_name: ${{ vars.MASTODON_STREAMING_IMAGE_NAME }}
run: |
# If custom image names are configured, use them; otherwise, default to both
# Docker Hub (tootsuite) and GitHub Container Registry (ghcr.io) for wider distribution
if [ -n "$config_mastodon_image_name" ]; then
{
echo 'image_name<<EOF'
echo "$config_mastodon_image_name"
echo 'EOF'
} >> "$GITHUB_OUTPUT"
else
{
echo 'image_name<<EOF'
echo 'tootsuite/mastodon'
echo 'ghcr.io/mastodon/mastodon'
echo 'EOF'
} >> "$GITHUB_OUTPUT"
fi
if [ -n "$config_mastodon_streaming_image_name" ]; then
{
echo 'streaming_image_name<<EOF'
echo "$config_mastodon_streaming_image_name"
echo 'EOF'
} >> "$GITHUB_OUTPUT"
else
{
echo 'streaming_image_name<<EOF'
echo 'tootsuite/mastodon-streaming'
echo 'ghcr.io/mastodon/mastodon-streaming'
echo 'EOF'
} >> "$GITHUB_OUTPUT"
fi
outputs:
image_name: ${{ steps.repository_vars.outputs.image_name }}
streaming_image_name: ${{ steps.repository_vars.outputs.streaming_image_name }}
build-image:
needs: compute-suffix
needs: [compute-suffix, compute-prefix]
uses: ./.github/workflows/build-container-image.yml
with:
file_to_build: Dockerfile
cache: false
push_to_images: |
tootsuite/mastodon
ghcr.io/mastodon/mastodon
${{ needs.compute-prefix.outputs.image_name }}
version_prerelease: ${{ needs.compute-suffix.outputs.prerelease }}
labels: |
org.opencontainers.image.description=Nightly build image used for testing purposes
@ -39,14 +82,13 @@ jobs:
secrets: inherit
build-image-streaming:
needs: compute-suffix
needs: [compute-suffix, compute-prefix]
uses: ./.github/workflows/build-container-image.yml
with:
file_to_build: streaming/Dockerfile
cache: false
push_to_images: |
tootsuite/mastodon-streaming
ghcr.io/mastodon/mastodon-streaming
${{ needs.compute-prefix.outputs.streaming_image_name }}
version_prerelease: ${{ needs.compute-suffix.outputs.prerelease }}
labels: |
org.opencontainers.image.description=Nightly build image used for testing purposes