{"id":17552583,"url":"https://github.com/iloveitaly/github-action-nixpacks","last_synced_at":"2025-04-12T05:09:01.862Z","repository":{"id":228838377,"uuid":"775054671","full_name":"iloveitaly/github-action-nixpacks","owner":"iloveitaly","description":"Build and push images with nixpacks","archived":false,"fork":false,"pushed_at":"2025-04-02T17:59:52.000Z","size":70,"stargazers_count":29,"open_issues_count":2,"forks_count":7,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-02T18:50:40.247Z","etag":null,"topics":["docker","nixpacks"],"latest_commit_sha":null,"homepage":"https://github.com/iloveitaly/github-action-nixpacks","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iloveitaly.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-20T17:16:04.000Z","updated_at":"2025-04-02T18:00:14.000Z","dependencies_parsed_at":"2024-06-09T07:26:27.992Z","dependency_job_id":"2f959bfa-3194-45bc-9047-ae9a98b6d84d","html_url":"https://github.com/iloveitaly/github-action-nixpacks","commit_stats":null,"previous_names":["iloveitaly/github-action-nixpacks"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iloveitaly%2Fgithub-action-nixpacks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iloveitaly%2Fgithub-action-nixpacks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iloveitaly%2Fgithub-action-nixpacks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iloveitaly%2Fgithub-action-nixpacks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iloveitaly","download_url":"https://codeload.github.com/iloveitaly/github-action-nixpacks/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248519545,"owners_count":21117761,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","nixpacks"],"created_at":"2024-10-21T05:43:15.510Z","updated_at":"2025-04-12T05:09:01.845Z","avatar_url":"https://github.com/iloveitaly.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nixpacks Build and Push Action\n\nThis GitHub Action utilizes [Nixpacks](https://nixpacks.com) to build a Docker image for your application and (optionally) push the image to a Docker registry. Nixpacks generates an OCI-compliant container image from your application source without the need for a Dockerfile.\n\nIt's very opinionated out the box (as software should be!) but allows you to customize much of the functionality if you want.\n\n## Features\n\n- **Multi-architecture builds**: this is explained more in detail below.\n- **Default tags**: a unix timestamp, sha, and `latest` tag are automatically generated for each build.\n- **Default labels**: revision, author, build date, github repo, etc are all added automatically.\n- **Nixpacks options**: you add pass most (all?) nixpacks cli arguments to the action to customize your build as you would locally.\n\n## Inputs\n\n- `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.\n- `tags`: A comma-separated list of tags to apply to the built image. Defaults to unix timestamp, git SHA, and `latest`.\n- `labels`: An optional, comma-separated list of metadata labels to add to the image.\n- `platforms`: An optional, comma-separated list of target platforms for the build.\n- `pkgs`: Optional additional Nix packages to install in the environment.\n- `apt`: Optional additional Apt packages to install in the environment.\n- `push`: A boolean flag to indicate whether to push the built image to the registry. Default is `false`. Required for multi-architecture builds.\n- `cache`: A boolean flag to indicate whether to use the build cache. \n  Cache speeds up the CI by reusing docker layers from previous builds.\n  Default is `false`.\n  (NOTE: The cache is shared between all builds in the repository. Some cache metadata will be inlined in the final image.)\n  See the [Nixpacks documentation](https://nixpacks.com/docs/configuration/caching) for more information.\n- `cache_tag`: A single tag to use for the cache image. Required if `cache` is `true`.\n  Defaults to `ghcr.io/org/app:latest` where `org/app` is the repository the workflow runs into.\n- `env`: Optional environment variables to set during the build.\n\n## Usage\n\n[Here's an example of this workflow in a live project:](https://github.com/iloveitaly/github-overlord/blob/master/.github/workflows/build_and_publish.yml)\n\n```yaml\n  - name: Build and push Docker images\n    uses: iloveitaly/github-action-nixpacks@main\n    with:\n      push: true\n```\n\nMulti-architecture builds are easy:\n\n```yaml\n- name: Build and push Docker images\n  uses: iloveitaly/github-action-nixpacks@main\n  with:\n    platforms: \"linux/amd64,linux/arm64\"\n    push: true\n```\n\nEnsure that your GitHub Actions runner has Docker installed and configured correctly, especially if you're pushing to a private registry. Here's a full example which also\nshows how to override the default tags:\n\n```yaml\nname: Build \u0026 Publish\n\non:\n  push:\n    branches: [main, master]\n  pull_request:\n    branches: [main, master]\n\nenv:\n  IMAGE_NAME: ghcr.io/${{ github.repository }}\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n\n    steps:\n      - uses: actions/checkout@v4\n\n      - name: Login to GitHub Container Registry\n        uses: docker/login-action@v3\n        with:\n          registry: ghcr.io\n          username: ${{ github.actor }}\n          password: ${{ secrets.GITHUB_TOKEN }}\n\n      # create a unique tag for each build for debugging\n      - name: Set Docker tag\n        id: date\n        run: echo \"DATE_STAMP=$(date +%s)\" \u003e \"$GITHUB_ENV\"\n\n      - name: Build and push Docker images\n        uses: iloveitaly/github-action-nixpacks@main\n        with:\n          push: true\n          tags: |\n            ${{ env.IMAGE_NAME }}:custom-${{ env.DATE_STAMP }}\n            ${{ env.IMAGE_NAME }}:awesome-latest\n```\n\n### Multi-architecture builds\n\nThese are tricky and not supported by nixpacks by default. This action makes it easy to create multi-architecture builds with nixpacks.\n\n\u003c!-- TODO add blog post when complete --\u003e\n\nSome things to keep in mind:\n\n* `push` is required when building for multiple architectures.\n* For each platform, an auto-generated tag is generated and pushed.\n* There are some [TODOs](/TODO) that I won't get to until I need them.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filoveitaly%2Fgithub-action-nixpacks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Filoveitaly%2Fgithub-action-nixpacks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filoveitaly%2Fgithub-action-nixpacks/lists"}