google-github-actions / example-workflows

Repository to demonstrate example workflows.
Apache License 2.0
64 stars 27 forks source link

Fix documentation + Added alternate way to auth for docker #5

Closed mpiorowski closed 2 years ago

mpiorowski commented 2 years ago
google-cla[bot] commented 2 years ago

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

mpiorowski commented 2 years ago

Fix #4

sethvargo commented 2 years ago

Hi @mpiorowski

Are you tagging images with a github SHA or are you pushing images named a GitHub SHA? The : indicates which label to use.

mpiorowski commented 2 years ago

@sethvargo The thing is, that the : was just not working (so the tag name). To be truthfully, i was writing this github action 1-2 months ago, so i don't remember the error. Maybe even something changes by that day and it will work now. But as of now, with / everything still works perfectly.

sethvargo commented 2 years ago

Hi @mpiorowski

It depends on your repo layout. If you've created container images that are named the GitHub SHA, then you need to slash. If you are creating container images named $SERVICE and then tagging them with the GitHub SHA, you need the colon. The preferred approach in the community is to use tags, so I believe the example workflow is correct.

mpiorowski commented 2 years ago

@sethvargo First of all, thanks for quick replies :)

So i checked the deploy with the initial setup, and the error i get is: name invalid: Missing image name. Pushes should be of the form docker push HOST-NAME/PROJECT-ID/REPOSITORY/IMAGE

And it seems right, cos right now we are ending our image url on REPOSITORY.

So maybe we should suggest the follwoing url? :

${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPOSITORY }}/${{ env.SERVICE }}:${{ github.sha }}

I tried this one and everythings works ;)

sethvargo commented 2 years ago

Yea, it should be:

LOCATION-docker.pkg.dev/PROJECT_ID/REPOSITORY/IMAGE:TAG

@verbanicm

mpiorowski commented 2 years ago

Updated pr with the new url's