Skip to content
Merged
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
35 changes: 33 additions & 2 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ jobs:
org.opencontainers.image.documentation=https://github.com/TryGhost/ActivityPub
org.opencontainers.image.source=https://github.com/TryGhost/ActivityPub

- name: "Migrations Docker meta"
- name: "Migrations Docker meta for private registry"
id: migrations-docker-metadata
uses: docker/metadata-action@v5
with:
Expand All @@ -117,6 +117,27 @@ jobs:
type=semver,pattern={{major}}
type=sha,priority=1100

- name: "ActivityPub Migrations Docker metadata for public registry"
id: activitypub-migrations-docker-metadata-public
if: github.ref == 'refs/heads/main'
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/tryghost/activitypub-migrations
tags: |
type=edge,branch=main
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha,priority=1100
labels: |
org.opencontainers.image.title=Ghost — ActivityPub
org.opencontainers.image.description=Federate your Ghost site with ActivityPub to join the world's largest open network.
org.opencontainers.image.vendor=Ghost Foundation
org.opencontainers.image.licenses=MIT
org.opencontainers.image.documentation=https://github.com/TryGhost/ActivityPub
org.opencontainers.image.source=https://github.com/TryGhost/ActivityPub

- name: "Build Docker Image for ActivityPub"
uses: docker/build-push-action@v6
with:
Expand Down Expand Up @@ -180,14 +201,24 @@ jobs:
labels: ${{ steps.activitypub-docker-metadata-public.outputs.labels }}
platforms: linux/amd64

- name: "Push Migrations Docker Image"
- name: "Push Migrations Docker image to private registry"
if: github.ref == 'refs/heads/main' || (github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.action == 'reopened' || github.event.action == 'labeled' || github.event.action == 'unlabeled'))
uses: docker/build-push-action@v6
with:
context: migrate
push: true
tags: ${{ steps.migrations-docker-metadata.outputs.tags }}

Comment on lines +204 to 211
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Include labels for private migrations image push
The private registry push step omits the labels output from metadata, resulting in unlabeled images. Add the labels (and optionally platforms) to keep consistency with other push steps.

@@ -209,3 +209,5
           push: true
           tags: ${{ steps.migrations-docker-metadata.outputs.tags }}
+          labels: ${{ steps.migrations-docker-metadata.outputs.labels }}
+          platforms: linux/amd64
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: "Push Migrations Docker image to private registry"
if: github.ref == 'refs/heads/main' || (github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.action == 'reopened' || github.event.action == 'labeled' || github.event.action == 'unlabeled'))
uses: docker/build-push-action@v6
with:
context: migrate
push: true
tags: ${{ steps.migrations-docker-metadata.outputs.tags }}
- name: "Push Migrations Docker image to private registry"
if: github.ref == 'refs/heads/main' || (github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.action == 'reopened' || github.event.action == 'labeled' || github.event.action == 'unlabeled'))
uses: docker/build-push-action@v6
with:
context: migrate
push: true
tags: ${{ steps.migrations-docker-metadata.outputs.tags }}
labels: ${{ steps.migrations-docker-metadata.outputs.labels }}
platforms: linux/amd64
🤖 Prompt for AI Agents
In .github/workflows/cicd.yml around lines 205 to 212, the step pushing the
migrations Docker image to the private registry is missing the inclusion of
labels from the metadata output. To fix this, add the labels field using the
appropriate output from the metadata step, and optionally include platforms to
match other push steps. This ensures the pushed image is properly labeled and
consistent with other images.

- name: "Push Migrations Docker image to public registry"
if: github.ref == 'refs/heads/main'
uses: docker/build-push-action@v6
with:
context: migrate
push: true
tags: ${{ steps.activitypub-migrations-docker-metadata-public.outputs.tags }}
labels: ${{ steps.activitypub-migrations-docker-metadata-public.outputs.labels }}
platforms: linux/amd64

- uses: tryghost/actions/actions/slack-build@main
if: failure() && github.event_name == 'push' && github.ref == 'refs/heads/main'
with:
Expand Down