Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish images to ghcr.io #58

Merged
merged 7 commits into from
Jan 8, 2025
Merged

Publish images to ghcr.io #58

merged 7 commits into from
Jan 8, 2025

Conversation

j-mueller
Copy link
Collaborator

@j-mueller j-mueller commented Jan 8, 2025

Publish the two images to GHCR.

  • When the workflow is triggered from a pull request: Use pr-${pull_request_number} as the tag of the image
  • When the workflow is triggered from a git tag: Use ${version} as the tag of the image

The PR-specific builds should make it easier to try out in-progress changes locally if the full toolchain is not available.

@j-mueller
Copy link
Collaborator Author

We should apply some distributive law to nix-build the images first and then parallelise the workflow by image. Currently we start a separate workflow for each image, which consumes a lot more compute-minutes.

@j-mueller j-mueller marked this pull request as ready for review January 8, 2025 12:29
@j-mueller j-mueller requested a review from choener January 8, 2025 15:34
@j-mueller
Copy link
Collaborator Author

Test with

docker run --rm --publish 8080:8080 ghcr.io/input-output-hk/wst-poc-mock-server:pr-58 (or podman equivalent)

curl -v localhost:8080/api/v1/healthcheck should then return code 200

@choener
Copy link
Collaborator

choener commented Jan 8, 2025

We should apply some distributive law to nix-build the images first and then parallelise the workflow by image. Currently we start a separate workflow for each image, which consumes a lot more compute-minutes.

I have some preliminary work in .github.com/workflows/ci-nix.yaml.
But cache restore is problematic:

  • I will have to prune the nix cache and only store those store paths that are locally built (github limitations on space)
  • Then restore correctly
    Alternatively, cachix could be used ...

Copy link
Collaborator

@choener choener left a comment

Choose a reason for hiding this comment

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

Tried and works for me.
Have left comment on missing hashing.

@j-mueller j-mueller merged commit a313175 into main Jan 8, 2025
5 checks passed
@j-mueller j-mueller deleted the 56-publish-image branch January 8, 2025 18:00
@j-mueller j-mueller linked an issue Jan 8, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Publish image to GH registry
2 participants