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

chore: Automate container image building #4

Merged
merged 1 commit into from
Apr 28, 2024

Conversation

miry
Copy link
Contributor

@miry miry commented Apr 28, 2024

Build for platform linux/arm64 and linux/amd64.
Add tag base on git tags:

edge - any last build
latest - last build base on default branch changes vx.y.z - build connected to the git tag
pr-xxx - build related to PR

Build images in Dockerhub and Github packages.
For DockerHub it requires secrets: DOCKER_USERNAME and DOCKER_PASSWORD

Tophat

Example of job for my fork push to master branch: https://github.com/miry/rails_app_operator/actions/runs/8868090021/job/24347314572

Example of job for my fork for new tag: https://github.com/miry/rails_app_operator/actions/runs/8868182984/job/24347505933

Results:

Build for platform `linux/arm64` and `linux/amd64`.
Add tag base on git tags:

`edge` - any last build
`latest` - last build base on default branch changes
`vx.y.z` - build connected to the git tag
`pr-xxx` - build related to PR
@miry miry force-pushed the github-action-docker branch from 4426f4c to 8d797c8 Compare April 28, 2024 14:08
@miry miry marked this pull request as ready for review April 28, 2024 14:10
push:
branches:
- main
- master
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added master, as I am using it on my fork. But I am ok to remove it, let me know your preference.

Copy link
Owner

Choose a reason for hiding this comment

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

It's fine to keep both. The only reasons I know of to restrict them are to avoid being charged for too many build hours and to avoid being charged too much for container images storage. I don't think I'm in danger of either of those — these images are like 10MB and are built about 4 times every few months.

@jgaskins
Copy link
Owner

Amazing, I hadn't setup automated builds specifically because I thought GHA didn't support arm64 builds. GHA not supporting arm64 was the main reason the postgis project doesn't provide arm64 container images.

I use arm64 nodes on GCP (I don't know how, but I got them for free), so I need it built for that arch, so I've just been building it manually. So I'm really glad you found a way to make this work!

@jgaskins jgaskins merged commit ca7f6cc into jgaskins:main Apr 28, 2024
@miry miry deleted the github-action-docker branch April 28, 2024 19:41
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.

2 participants