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

Adds CI/CD pipeline with support for multiple platforms #15

Merged
merged 2 commits into from
Jan 9, 2024
Merged

Adds CI/CD pipeline with support for multiple platforms #15

merged 2 commits into from
Jan 9, 2024

Conversation

jbonadiman
Copy link
Contributor

Closes #13

📑 Description

I've added a simple pipeline that builds the project on code changes and pull requests and upon any code change to the main branch, also uploads the image to the GHCR.
I chose to use the GHCR because I believe it would be more simple to setup than docker hub (your docker hub account info would have to be setup in the envs of the repo). Feel free to change that, if you wish.

✅ Checks

  • My pull request adheres to the code style of this project if any
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed if any

@jbonadiman jbonadiman mentioned this pull request Jan 8, 2024
@wasi-master
Copy link
Owner

So I also want it to set up docker hub, how to do that? Any links to resources is appreciated.

@jbonadiman
Copy link
Contributor Author

So I also want it to set up docker hub, how to do that? Any links to resources is appreciated.

The step that logins in GHCR needs to change to something like this:

  - name: 👤 login to docker hub
        if: github.event_name != 'pull_request'
        uses: docker/login-action@v1
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_TOKEN }}

And those secrets (DOCKERHUB_USERNAME and DOCKERHUB_TOKEN) need to be configured in the repo secrets (Settings > Secrets and variables > Actions).
I'm gonna change the steps for the PR, just make sure to have the secrets set up if/when you approve the merge.

@wasi-master
Copy link
Owner

If I want both ghcr and dockee hub would I need two workflows or can I somehow merge them onto one? @jbonadiman

@jbonadiman
Copy link
Contributor Author

If I want both ghcr and dockee hub would I need two workflows or can I somehow merge them onto one? @jbonadiman

That's an interesting question. I guess you could go on the naive way and do: login docker hub -> push docker hub and then login ghcr -> push ghcr.
And the sophisticated way would be set it up in a way that at that point the workflow branches and each of these branches logins and pushes to different registries. I never did this and would require some testing.

But why exactly would you want the image in both places? I mean, those two registries work with free-tiers, so you would be consuming both free-tiers of your account at the same time, I don't see the benefit of doing that 🤔

@wasi-master
Copy link
Owner

But why exactly would you want the image in both places?

Good question 🤔. I think I did it at first because several different people wanted it on each of the platforms and I couldn't decide so I said why not do both.

@jbonadiman
Copy link
Contributor Author

But why exactly would you want the image in both places?

Good question 🤔. I think I did it at first because several different people wanted it on each of the platforms and I couldn't decide so I said why not do both.

I'd say just stick with what's best/more practical for you and that's fine. Particularly, I never saw a self-hosted project deploying images to multiple registries 🤔

@wasi-master
Copy link
Owner

wasi-master commented Jan 8, 2024

I'd say just stick with what's best/more practical for you

I would stick with ghcr thanks, you can undo that commit.

@jbonadiman
Copy link
Contributor Author

I'd say just stick with what's best/more practical for you

I would stick with ghcr thanks, you can undo that commit.

Done

@wasi-master wasi-master merged commit 26ea406 into wasi-master:main Jan 9, 2024
2 checks passed
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.

[FEAT]: ARM support
2 participants