Skip to content

Conversation

@camalot
Copy link
Contributor

@camalot camalot commented Mar 30, 2023

I am not able to test this AFAIK because of permissions and such, but this should log in to both dockerhub and ghcr, and add image tags for both dockerhub and ghcr.

Closes #1444 and #2009

itzg
itzg previously approved these changes Mar 30, 2023
Copy link
Owner

@itzg itzg left a comment

Choose a reason for hiding this comment

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

The changes look right to me. I'll try to lookup how I did my initial testing of the image publishing 😀.

@itzg
Copy link
Owner

itzg commented Mar 30, 2023

...oh, I remember now. The build triggers inlcude branches that start with test/.

@itzg
Copy link
Owner

itzg commented Mar 30, 2023

As far as you testing it, I think it'll work for a non-PR'ed branch that starts with test/ as long as you have the Docker hub credentials declared in your repo actions secrets.

@camalot
Copy link
Contributor Author

camalot commented Mar 30, 2023

I will see if i can get it to test when I take lunch.

* master:
  added information on the escaping of $ in the CF API Key (itzg#2050)
@camalot
Copy link
Contributor Author

camalot commented Mar 31, 2023

i see in the build-multiarch a reference to MODS_FORGEAPI_KEY. can you point me to where I can request a key? I am creating a test/ branch to make sure this all works.

@itzg
Copy link
Owner

itzg commented Mar 31, 2023

That's one in the same as CF_API_KEY just it's from an older contributes feature. (I need to deprecate away that feature at some point.)

It should actually be optional for the build and didn't remember that I even had that set in my repo secrets 😀

@camalot
Copy link
Contributor Author

camalot commented Mar 31, 2023

Ok, i was going to try my CF Key. thanks.

@itzg
Copy link
Owner

itzg commented Mar 31, 2023

...and now that I rediscovered that, makes me realize I could be re-enabling the build time test for auto CurseForge by re-mapping that variable

@itzg
Copy link
Owner

itzg commented Mar 31, 2023

If you want to include that with your PR it would be a copy of this line

MODS_FORGEAPI_KEY: ${{ secrets.MODS_FORGEAPI_KEY }}

but with CF_API_KEY being the resulting variable.

@camalot
Copy link
Contributor Author

camalot commented Mar 31, 2023

ive got a test/ branch running now with those changes, since this PR is open on the non-test branch, if it is successful, I will merge those changes back in to this branch, and will reference the test branch action runs.

@camalot
Copy link
Contributor Author

camalot commented Mar 31, 2023

@camalot
Copy link
Contributor Author

camalot commented Mar 31, 2023

Login for GHCR was successful for all platforms. as was the build. the build and push was also successful, but doesn't actually push (so it isn't fully tested with the github.token) since it isn't running from a PR to master.

@camalot
Copy link
Contributor Author

camalot commented Mar 31, 2023

I have a feeling that using github.token isn't going to have access to push to GHCR. I haven't tested this feeling yet though.

EDIT:

I take that back. i have a repo that pushes to GHCR and uses github.token

* master:
  Auto CurseForge, added docs to use env file (itzg#2054)
@itzg
Copy link
Owner

itzg commented Apr 3, 2023

I'm sorry that I forgot about this PR. Later today I'll either do a quick test branch build or just merge and tweak configs from there if needed.

@itzg
Copy link
Owner

itzg commented Apr 3, 2023

Pushed some fixes to the build to handle test/* branches. Apparently I broke it was back when I switched to matrix builds.

@itzg itzg added the ci/push-image Triggers CI to push an image for this PR label Apr 3, 2023
@camalot
Copy link
Contributor Author

camalot commented Apr 4, 2023

I see that the push to ghcr.io is failing with a 500. i may modify the job that pushes to have it push to my docker hub and ghcr. see if i can reproduce it.

@camalot
Copy link
Contributor Author

camalot commented Apr 4, 2023

I got an error, but mine was a 403 forbidden. I am trying now to change the "actions settings" on my fork to allow read/write, to see if that allows the push.

@itzg
Copy link
Owner

itzg commented Apr 4, 2023

That would be great. Using the github.token way it was mostly 500's:

https://github.com/itzg/docker-minecraft-server/actions/runs/4600691357

Using secrets.GITHUB_TOKEN, which I just pushed, it was a mix of success and 403's

https://github.com/itzg/docker-minecraft-server/actions/runs/4603497390/jobs/8133557812

I'm suspecting there is a rate limit on GHCR publish operations, where 14 concurrent ones probably exceeds that.

@camalot
Copy link
Contributor Author

camalot commented Apr 4, 2023

https://github.com/camalot/docker-minecraft-server/pkgs/container/minecraft-server

I changed the action settings to read/write and it pushed to ghcr for my fork, and my docker hub

image

@camalot
Copy link
Contributor Author

camalot commented Apr 4, 2023

@camalot
Copy link
Contributor Author

camalot commented Apr 4, 2023

Obviously i had to change the build-publish workflow to push to on a less restrictive criteria. but that is the only thing that should have been changed compared to what i pushed to this branch.

@itzg
Copy link
Owner

itzg commented Apr 4, 2023

i had to change the build-publish workflow to push to on a less restrictive criteria

Hmm, I had the workflow settings like you screenshot'ed above, so I'm wondering what you mean by these workflow changes?

The mix of success and 403's (and 500s) was very odd though. It's like the permissions are right, but something sporadically fails.

@camalot
Copy link
Contributor Author

camalot commented Apr 4, 2023

This is what i changed in my test/ branch to force it to push for me. everything else in my branch should be in-line with the rest of the changes in this PR.

image

Actually, im not 100% that I pulled in all the changes you pushed to this branch. Let me do that and run it again.

@camalot
Copy link
Contributor Author

camalot commented Apr 5, 2023

my test/ghcr-publish branch published successfully after making sure I had all your changes. the only change i made after that was changing back to use github.token vs secrets.GITHUB_TOKEN

@itzg
Copy link
Owner

itzg commented Apr 5, 2023

Can you point me to the latest build that went through for you? I'll put my test branch back to github.token and see how it is now.

@camalot
Copy link
Contributor Author

camalot commented Apr 5, 2023

@itzg itzg merged commit 3e9e64e into itzg:master Apr 9, 2023
adamancini pushed a commit to adamancini/docker-minecraft-server that referenced this pull request Jul 11, 2023
Co-authored-by: Geoff Bourne <itzgeoff@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/push-image Triggers CI to push an image for this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Release Docker Images on Github's Container registry

2 participants