-
-
Notifications
You must be signed in to change notification settings - Fork 111
ci: build and push devel image on master #508
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
ci: build and push devel image on master #508
Conversation
|
I tried it out locally by passing |
I'm fine with it because we need to test this anyway.
First, you are not compiling the project in the workflow so you have to add that step before start building the Docker image. Aside, I thought you wanted to use the In my opinion, just building for -- Additionally, we don't always want to trigger a Note that for now, we can comment the name: release-docker
on:
push:
branches:
- master
paths:
- release.docker.devel.yml
- .cargo/config.toml
- Cargo.lock
- Cargo.toml
- src/** |
|
Thanks for the feedback, @joseluisq.
The reason why I tried to use the other Dockerfiles is that I saw it contains a build stage. I overlooked that it doesn't actually build but downloads the release. So I will switch to the
|
bc772fa to
349376b
Compare
|
I am at the point where I can't continue anymore. The login to Docker hub fails (commented out right now) and the push of the image fails with the token having insufficient scopes (although I am currently investigating the tags since it seems to be incorrect). I added building of the binary which is passed via cache to the other two jobs (building debian and scratch). I left the alpine image out because it requires a musl binary. Looking at the I also updated the versions of the actions to their latest major version. |
|
I am also testing building in the devel Dockerfile but there seem to be some system packages missing. Do you know which packages are required? FROM rust:1.83.0-alpine AS build
ENV RUST_BACKTRACE=1
RUN apk add --no-cache clang lld musl-dev
WORKDIR /app
COPY ./src ./src
COPY Cargo.toml .
COPY Cargo.lock .
RUN cargo build --locked --bin static-web-server -vv --release --features=all |
Your username simply does not have permission to push packages to permissions:
contents: read
packages: write
Yes, musl-based binaries are used on Alpine Docker images. About Alpine, let's forget about it for now and concentrate on debian/scratch only.
Yes, you will need some setup and dependencies. But I wouldn't try that. We have GitHub Actions with Ubuntu so let's keep using that. It is just fine to use and should compile without any issues for Linux amd64. -- I quickly looked at the PR I'm also fine with pushing to ghcr.io only for now. We don't need to push to Docker Hub, maybe in the future if we need it. |
Thanks. That is true. It's not being applied though. Maybe because it is coming from a fork? See: https://github.com/static-web-server/static-web-server/actions/runs/12248375532/job/34167957103?pr=508#step:1:19 I found some posts that mention changing the setting in the repo to "read and write" by default. Although that changes it for everything I believe.
Sounds good.
Sounds good.
Yes, it's because I reused the metadata action which didn't work with
That's fine. I removed the login to dockerhub. You might want to consider removing the old |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. That is true. It's not being applied though. Maybe because it is coming from a fork? See: https://github.com/static-web-server/static-web-server/actions/runs/12248375532/job/34167957103?pr=508#step:1:19
Yes, what I'm going to do is branch out from master and merge this PR onto that new branch (master-ci) just for verification purposes and conduct several tests there. I will manage this.
Just address the PR comments and switch to . The rest of the stuff looks fine to me.master-ci as the merging target
When done, then I will merge it and start testing the changes in a new PR.
joseluisq
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
) * chore: build and push devel image on master changes via ci workflow (#508) by @mschoettle * ci: build and push devel image on master * Temporarily enable devel docker release on pull request * add build release * ci: build only amd64 and use devel dockerfiles * temporarily disable login to docker hub * fix tag * add cache for binary * test release binary * move binary to the right place * update action versions * disable docker hub image * test tags * test tags * test tags * add permissions to scratch job * apply feedback * remove test step * Address comments * refactor: prefer job matrix strategy and x86_64-unknown-linux-musl --------- Co-authored-by: Matthias Schoettle <[email protected]>
|
@mschoettle FYI I finished the new workflow and tested it successfully on both branches. See #512 description and comments for more details. |
|
@joseluisq Thanks a lot for finishing it! And thanks for adding the co-authored-by :) |
Description
Build and push the
develtag for new commits onmaster. Further work is completed at #512.Related Issue
As discussed in #504 (comment)
Motivation and Context
I wanted to run the latest version locally and struggled to get it done. Since we discussed doing it in CI I went ahead and added another workflow based on a copy of
release.docker.yml.How Has This Been Tested?
Not yet since it only runs on
master. We could temporarily addpull_requesttoonto see if it runs successfully.Screenshots (if appropriate):