Giter VIP home page Giter VIP logo

github-action-nixpacks's Introduction

Nixpacks Build and Push Action

This GitHub Action utilizes Nixpacks to build your application into a Docker image and then pushes the image to a Docker registry. Nixpacks generates an OCI-compliant container image from your application source without the need for a Dockerfile.

Features

  • Nixpacks Integration: Leverages Nixpacks for building OCI-compliant Docker images from application source.
  • Flexible Tagging: Allows multiple tags to be specified for the built image.
  • Metadata Addition: Supports adding labels to the Docker image.
  • Platform Specification: Enables building for specific target platforms.
  • Package Inclusion: Offers the capability to include additional Nix and Apt packages in the build environment.

Inputs

  • context: The build's context, specifying the set of files located at the provided PATH or URL. It is required to point to your application source code.
  • tags: A comma-separated list of tags to apply to the built image. This field is required.
  • labels: An optional, comma-separated list of metadata labels to add to the image.
  • platforms: An optional, comma-separated list of target platforms for the build.
  • pkgs: Optional additional Nix packages to install in the environment.
  • apt: Optional additional Apt packages to install in the environment.

Usage

To use this action in your workflow, add the following step:

- uses: your-repo/nixpacks-build-push-action@main
  with:
    context: './path-to-app'
    tags: 'latest,stable'
    labels: 'version=1.0,framework=express'
    platforms: 'linux/amd64,linux/arm64'
    pkgs: 'nodejs,npm'
    apt: 'curl,git'

Ensure that your GitHub Actions runner has Docker installed and configured correctly, especially if you're pushing to a private registry.

Installation and Execution

The action automatically installs Nixpacks if it's not already present in the environment. Then, it constructs and executes a Nixpacks build command using the provided inputs. After the build, it pushes the tagged image(s) to the Docker registry.

Note:

  • The tags input is required to identify the image(s) in the registry uniquely.
  • If labels or platforms are specified, they are added to the build command to include in the Docker image.
  • Additional Nix or Apt packages can be specified through pkgs and apt inputs to customize the build environment.

Conclusion

This GitHub Action simplifies the process of building and deploying containerized applications by leveraging the power of Nixpacks, making it easier to integrate into CI/CD pipelines without the need for Dockerfiles.

github-action-nixpacks's People

Contributors

iloveitaly avatar

Watchers

 avatar  avatar

Forkers

waxarsatia

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.