Publish Docker Images to GH Packages on merge with main#86
Publish Docker Images to GH Packages on merge with main#86jaimehisao wants to merge 6 commits intomainfrom
Conversation
Domene99
left a comment
There was a problem hiding this comment.
where you not going to use matrix something for this pr?
| - name: Build Frontend Docker image | ||
| working-directory: ./app | ||
| run: | | ||
| docker login docker.pkg.github.com -u ${{ secrets.USERNAME }} --password ${{ secrets.GITHUB_TOKEN }} | ||
| docker build . --file Dockerfile --tag frontend | ||
| docker tag frontend docker.pkg.github.com/googleinterns/major-tom/frontend | ||
| docker push docker.pkg.github.com/googleinterns/major-tom/frontend | ||
| - name: Build Backend Docker image | ||
| working-directory: ./server | ||
| run: | | ||
| docker build . --file Dockerfile --tag backend | ||
| docker tag backend docker.pkg.github.com/googleinterns/major-tom/backend | ||
| docker push docker.pkg.github.com/googleinterns/major-tom/backend | ||
| - name: Build Keywords Docker image | ||
| working-directory: ./services/keywords | ||
| run: | | ||
| docker build . --file Dockerfile --tag keywords | ||
| docker tag keywords docker.pkg.github.com/googleinterns/major-tom/keywords | ||
| docker push docker.pkg.github.com/googleinterns/major-tom/keywords | ||
| - name: Build Search Docker image | ||
| working-directory: ./services/search | ||
| run: | | ||
| docker build . --file Dockerfile --tag search | ||
| docker tag search docker.pkg.github.com/googleinterns/major-tom/search | ||
| docker push docker.pkg.github.com/googleinterns/major-tom/search | ||
| - name: Build Parser Docker image | ||
| working-directory: ./services/parser-database | ||
| run: | | ||
| docker build . --file Dockerfile --tag parser-database | ||
| docker tag parser-database docker.pkg.github.com/googleinterns/major-tom/parser-database | ||
| docker push docker.pkg.github.com/googleinterns/major-tom/parser-database |
There was a problem hiding this comment.
the docker login could be moved to a separate step and then the build step could be parameterized as a matrix job
dmosc
left a comment
There was a problem hiding this comment.
Very nice!
Left some comments below.
| - name: Build Parser Docker image | ||
| working-directory: ./services/parser-database | ||
| run: | | ||
| docker build . --file Dockerfile --tag parser-database |
There was a problem hiding this comment.
I am pretty confident you can omit the --file flag as Docker looks for that file by default.
| run: | | ||
| docker login docker.pkg.github.com -u ${{ secrets.USERNAME }} --password ${{ secrets.GITHUB_TOKEN }} | ||
| docker build . --file Dockerfile --tag frontend | ||
| docker tag frontend docker.pkg.github.com/googleinterns/major-tom/frontend |
There was a problem hiding this comment.
Correct me if I am wrong but, are these URL's correct? I thought that for pushing to Google's Container Registry you had to prefix your images with the following format:
gcr.io/$PROJECT_ID/$IMAGE_NAME
i.e. gcr.io/major-tom-123/frontend
There was a problem hiding this comment.
I think this pr is about publishing our latest image to the repo not to gcp's container registry
| @@ -0,0 +1,42 @@ | |||
| name: Build Docker Images & Push to Registry | |||
|
|
|||
There was a problem hiding this comment.
I assume this is a cloudbuild yaml? I would leave cloudbuild in the name somewhere if so
| working-directory: ./server | ||
| run: | | ||
| docker build . --file Dockerfile --tag backend | ||
| docker tag backend docker.pkg.github.com/googleinterns/major-tom/backend |
There was a problem hiding this comment.
Isn't this tag lost if you don't push it with this tag too?
No description provided.