Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: docker build and push #2

Merged
merged 4 commits into from
Dec 3, 2024
Merged

ci: docker build and push #2

merged 4 commits into from
Dec 3, 2024

Conversation

minhd-vu
Copy link
Collaborator

Description

Jira / Linear Tickets

Testing

  • Test A
  • Test B

if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
Copy link

Choose a reason for hiding this comment

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

If in some cases, we're pushing from fork for some reason, the secrets may not be available from the forked repo. So this step will likely fail. But immediately, it may not be a big issue - but a workaround would be to add a check for the env variable:

# This step will only execute if the necessary secrets are available, preventing failures
# on pull requests from forked repositories.
if: ${{ env.DOCKERHUB_USERNAME && env.DOCKERHUB_TOKEN }}
env:
    DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
    DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nice catch! I didn't think of this 💯

Copy link

@jhkimqd jhkimqd left a comment

Choose a reason for hiding this comment

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

+1 lgtm

@minhd-vu minhd-vu merged commit 61111b2 into main Dec 3, 2024
5 checks passed
@minhd-vu minhd-vu deleted the minhd-vu/docker branch December 3, 2024 14:56
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