-
Notifications
You must be signed in to change notification settings - Fork 6
Publish Docker Images to GH Packages on merge with main #86
base: main
Are you sure you want to change the base?
Conversation
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the docker login
could be moved to a separate step and then the build step could be parameterized as a matrix job
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this pr is about publishing our latest image to the repo not to gcp's container registry
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.
Is this a cloudbuild
@@ -0,0 +1,42 @@ | |||
name: Build Docker Images & Push to Registry | |||
|
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this tag lost if you don't push it with this tag too?
No description provided.