Skip to content

Build Docker image and push to Dockerhub - #1080

Merged
mockdeep merged 2 commits into
stringer-rss:mainfrom
guidopetri:ci-build-docker
Aug 21, 2023
Merged

mockdeep merged 2 commits into
stringer-rss:mainfrom
guidopetri:ci-build-docker

Conversation

@guidopetri

Copy link
Copy Markdown
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
Copy Markdown
Collaborator Author

@mockdeep hopefully it works this time!

@mockdeep mockdeep left a comment

Copy link
Copy Markdown
Collaborator

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.

Comment thread .github/workflows/build.yaml Resolved
Comment thread .github/workflows/build.yaml Resolved
Comment thread .github/workflows/build.yaml Resolved
Comment on lines +42 to +43
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

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

Comment thread .github/workflows/build.yaml Resolved
tags: |
${{ steps.get-tag-latest.outputs.tags }}
${{ steps.get-tag-sha.outputs.tags }}
cache-from: type=gha

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@guidopetri

Copy link
Copy Markdown
Collaborator Author

It worked?!!

@mockdeep

Copy link
Copy Markdown
Collaborator

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

@mockdeep

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

2 participants