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

Build Docker image and push to Dockerhub #1080

Merged
merged 2 commits into from
Aug 21, 2023

Conversation

guidopetri
Copy link
Collaborator

As mentioned in #1051, the CircleCI docker build step isn't working, and we want to move it to a Github Action instead. This PR has two commits:

This will require two secrets that I believe can be set in the repository settings somewhere: one for a DOCKERHUB_USERNAME and another for a DOCKERHUB_TOKEN. I also went ahead and added both an amd64 and an arm64 build here, and am hoping that it just works (tm).

I also once again set the build and push to only happen when main is pushed to / gets new commits, but I think we can change that to work only on this branch from my fork if we want to test before merging.

@guidopetri
Copy link
Collaborator Author

@mockdeep hopefully it works this time!

Copy link
Collaborator

@mockdeep mockdeep left a comment

Choose a reason for hiding this comment

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

Thanks so much for this! I think this will help a lot with environment issues.

.github/workflows/build.yaml Outdated Show resolved Hide resolved
.github/workflows/build.yaml Outdated Show resolved Hide resolved
.github/workflows/build.yaml Outdated Show resolved Hide resolved
Comment on lines 42 to 43
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I've set these secrets, so hopefully that'll work.

.github/workflows/build.yaml Outdated Show resolved Hide resolved
tags: |
${{ steps.get-tag-latest.outputs.tags }}
${{ steps.get-tag-sha.outputs.tags }}
cache-from: type=gha
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I believe that this cache-from will cache to/from the Github Actions environment, so there's no need to pull an image locally, but I'm not 100% confident.

@guidopetri
Copy link
Collaborator Author

Updated the PR with your suggestions and rebased them into the second commit. Should I keep the run-tests name on CircleCI instead of reverting to build?

@mockdeep
Copy link
Collaborator

Let's give it a try! I'm wondering why we don't see the image building on this PR, but maybe we need to merge it before it will run.

Should I keep the run-tests name on CircleCI instead of reverting to build

I think build is fine for now. We can always revisit later.

@mockdeep mockdeep merged commit 620b8e0 into stringer-rss:main Aug 21, 2023
1 check passed
@guidopetri
Copy link
Collaborator Author

It worked?!!

@mockdeep
Copy link
Collaborator

Oh, I didn't even think to look. It did!

@mockdeep
Copy link
Collaborator

https://hub.docker.com/repository/docker/stringerrss/stringer/general

Ni-g-3l pushed a commit to Ni-g-3l/stringer that referenced this pull request Aug 24, 2023
* revert CircleCI build changes

* add build and push to dockerhub via github actions
@guidopetri guidopetri deleted the ci-build-docker branch August 26, 2023 02:39
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.

None yet

2 participants