Skip to content

Added workflow to push docker image to ghcr.io#7

Open
VoidChaosCreate wants to merge 6 commits intoDocketGoAI:mainfrom
VoidChaosCreate:main
Open

Added workflow to push docker image to ghcr.io#7
VoidChaosCreate wants to merge 6 commits intoDocketGoAI:mainfrom
VoidChaosCreate:main

Conversation

@VoidChaosCreate
Copy link

On push and pull requests in the main branch, the workflow builds the docker image and pushes it to the ghcr.io registry. actor and GITHUB_TOKEN are used for authentication.

Copy link
Collaborator

@DanBrown47 DanBrown47 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ! Need few clarification and add test

uses: actions/checkout@v3

- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the hash value after login-action ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hash refers to specific version of docker/login-action. Here, it refers to v2. The hash can be replaced with "docker/login-action@v2" at every instance of the codes. For more reference, you can refer here.


- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that hash value needed ?

Copy link
Author

@VoidChaosCreate VoidChaosCreate Feb 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9" can be replaced with "docker/login-action@v2"

IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add Test, as we have tested
Steps follow

  • build
  • test
  • push to docker

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. Will update you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants