Skip to content
This repository has been archived by the owner on May 15, 2023. It is now read-only.

Publish Docker Images to GH Packages on merge with main #86

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

jaimehisao
Copy link
Contributor

No description provided.

@jaimehisao jaimehisao changed the title Create docker-image.yml Publish Docker Images to GH Packages on merge with main Aug 25, 2020
@jaimehisao jaimehisao marked this pull request as ready for review August 25, 2020 20:26
Copy link
Contributor

@Domene99 Domene99 left a 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?

Comment on lines +12 to +42
- 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
Copy link
Contributor

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

Copy link
Contributor

@dmosc dmosc left a 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
Copy link
Contributor

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
Copy link
Contributor

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

Copy link
Contributor

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

Copy link

@anniefu anniefu left a 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

Copy link

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
Copy link

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?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants