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

feat: add basic docker setup and CI #11

Merged
merged 3 commits into from
Mar 8, 2024
Merged

Conversation

rustamch
Copy link
Collaborator

No description provided.

Copy link
Collaborator

@codingonapotato codingonapotato left a comment

Choose a reason for hiding this comment

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

Looks good to me

@mavehur
Copy link
Collaborator

mavehur commented Feb 26, 2024

I have two questions about specifying platforms and adding caching. Let me know what you think!

  1. Will we want to specify the target platform for the build output like the following:
    platforms: linux/amd64, linux/arm64, darwin/amd64
  1. I suggest adding caching to reduce build time
cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:cache
cache-to: type=inline

Overall, it'd look like this:

      # Build and push Docker image
      - name: Build and push Docker image
        uses: docker/build-push-action@v5
        with:
          context: .
          push: true
          tags: |
            ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:${{ github.sha }}
            ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:latest
          platforms: linux/amd64, linux/arm64, darwin/amd64
          cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:cache
          cache-to: type=inline,mode=max

@rustamch
Copy link
Collaborator Author

rustamch commented Mar 8, 2024

I have two questions about specifying platforms and adding caching. Let me know what you think!

  1. Will we want to specify the target platform for the build output like the following:
    platforms: linux/amd64, linux/arm64, darwin/amd64
  1. I suggest adding caching to reduce build time
cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:cache
cache-to: type=inline

Overall, it'd look like this:

      # Build and push Docker image
      - name: Build and push Docker image
        uses: docker/build-push-action@v5
        with:
          context: .
          push: true
          tags: |
            ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:${{ github.sha }}
            ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:latest
          platforms: linux/amd64, linux/arm64, darwin/amd64
          cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:cache
          cache-to: type=inline,mode=max

Very good suggestions, thank you! Will add that.

@rustamch rustamch merged commit 8ceac8d into main Mar 8, 2024
1 check 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.

4 participants