ioos / ioos-us

The homepage for the IOOS.us website
https://ioos.us/
MIT License
0 stars 16 forks source link

Added new GHA to build and push #237

Closed nguyandy closed 1 year ago

nguyandy commented 3 years ago

Hi @ocefpaf! Can you take a look at this when you get the chance.

Here I'm using the Buildx actions to build and push the image to Dockerhub. With this GHA, the DOCKERHUB_USERNAME and DOCKERHUB_TOKEN will have to be added to the repo's secrets.

This seems to do the trick when I test with my repo/Dockerhub account.

nguyandy commented 3 years ago

@ocefpaf I updated it to run on push/pr.

I had to replace in ioos/ioos-us:${{ github.event.release.tag_name }} with ioos/ioos-us:test_20210110 on line 31. Looks like ${{ github.event.release.tag_name }} only works when the action is triggered on release.

nguyandy commented 3 years ago

@ocefpaf, do you have access / can you setup the repo secrets for DOCKERHUB_USERNAME and DOCKERHUB_TOKEN? Or should I ask Micah for this?

ocefpaf commented 3 years ago

@ocefpaf, do you have access / can you setup the repo secrets for DOCKERHUB_USERNAME and DOCKERHUB_TOKEN? Or should I ask Micah for this?

I don't have admin rights here. @mwengren can you help @nguyandy set the secrets for GHA?

mwengren commented 3 years ago

@nguyandy If you can ping me on chat or somewhere secure to send them to me, I have access to the secrets screen for this repo. I don't have any access to DockerHub for IOOS, however, I believe that's in RPS' control.

ocefpaf commented 3 years ago

Hi @nguyandy do you still need help setting this up?

nguyandy commented 3 years ago

Hi @nguyandy do you still need help setting this up?

Thanks for heads up @ocefpaf. I just sent @mwengren the credentials to setup the env secrets. We should be set to test after that's setup.

mwengren commented 3 years ago

Added

nguyandy commented 3 years ago

@ocefpaf @mwengren I triggered the build workflow, but I'm still seeing a "Error: Username and password required" https://github.com/ioos/ioos-us/pull/237/checks?check_run_id=1915921784

Are the repo secrets set like below?

Screen Shot 2021-02-16 at 11 13 48 PM
mwengren commented 3 years ago

Yeah, they're Repository Secrets with this setup: DOCKERHUB_TOKEN Updated 5 days ago DOCKERHUB_USERNAME Updated 5 days ago

Let me know if I can help troubleshooting.

nguyandy commented 3 years ago

Hmm, that's strange. I just tried the same workflow + token/username on my repo and was able to successfully push to ioos docker hub. https://hub.docker.com/layers/ioos/ioos-us/test_gha/images/sha256-899de22869e5b20df6b2545a72aa71e1aa96af65dfd8b1a0cff83262c38632b2?context=explore

@ocefpaf, do we have to merge this PR to test? Not sure where the discrepancy is.