{"id":12376058,"name":"nais/docker-build-push","ecosystem":"actions","description":"Build and push docker image to the NAIS registry","homepage":null,"licenses":"mit","normalized_licenses":["MIT"],"repository_url":"https://github.com/nais/docker-build-push","keywords_array":[],"namespace":"nais","versions_count":33,"first_release_published_at":"2023-01-20T09:12:12.000Z","latest_release_published_at":"2026-09-23T07:18:40.000Z","latest_release_number":"v0","last_synced_at":"2026-09-26T17:07:50.142Z","created_at":"2025-10-12T00:33:05.468Z","updated_at":"2026-09-26T17:07:50.142Z","registry_url":"https://github.com/nais/docker-build-push","install_command":null,"documentation_url":null,"metadata":{"name":"NAIS Docker Build Push","description":"Build and push docker image to the NAIS registry","inputs":{"push_image":{"description":"Push image to registry","required":true,"default":"true"},"dockerfile":{"description":"Path to the Dockerfile. (default {docker_context}/Dockerfile)","required":false},"docker_context":{"description":"Docker build's context is the set of files located in the specified PATH or URL (default Git context)","required":true,"default":"."},"tag":{"description":"Custom docker tag","required":false},"project_id":{"description":"Google Cloud project ID","required":false},"identity_provider":{"description":"Workload Identity Provider","required":false},"tenant":{"description":"NAIS tenant","required":false,"default":"nav"},"team":{"description":"Team slug","required":true},"cache_from":{"description":"Docker buildx cache from","required":false,"default":"type=gha"},"cache_to":{"description":"Docker buildx cache to","required":false,"default":"type=gha,mode=max"},"no_cache":{"description":"Disable Docker buildx cache. When true, cache_from and cache_to are ignored so no cache is read or exported.","required":false,"default":"false"},"image_suffix":{"description":"Adds a suffiks to the generated docker image name","required":false},"pull":{"description":"Pull image before building","required":false,"default":"true"},"build_args":{"description":"List of build-time variables","required":false},"build_secrets":{"description":"List of secrets to expose to the build (e.g., key=string, GIT_AUTH_TOKEN=mytoken)","required":false},"outputs":{"description":"List of output destinations (format: type=local,dest=path)","required":false},"target":{"description":"Sets the target stage to build","required":false},"salsa":{"description":"enable image attestation for SLSA","required":false,"default":"true"},"byosbom":{"description":"Bring your own, use existing SBOM for SLSA","required":false,"default":"auto-generate-for-me-please.json"},"additional_sboms":{"description":"Newline-separated list of extra CycloneDX SBOM files to merge with the primary SBOM","required":false,"default":""},"platforms":{"description":"List of target platforms for build","required":false}},"outputs":{"salsa":{"description":"SLSA attestation","value":"${{ steps.set-outputs.outputs.salsa }}"},"digest":{"description":"Image digest","value":"${{ steps.set-outputs.outputs.digest }}"},"tag":{"description":"Release tag","value":"${{ steps.set-outputs.outputs.new_version }}"},"image":{"description":"Canonical image reference","value":"${{ steps.set-outputs.outputs.image }}"}},"runs":{"using":"composite","steps":[{"name":"NAIS login","uses":"nais/login@40b72a35a18ddf2ad74b632461139ab838cc2a2f","id":"login","with":{"project_id":"${{ inputs.project_id }}","identity_provider":"${{ inputs.identity_provider }}","team":"${{ inputs.team }}"}},{"name":"Setup environment","shell":"bash","id":"setup","run":"if [ ! -d \"${{ inputs.docker_context }}\" ]; then\n  echo \"::error ::Docker context not found: ${{ inputs.docker_context }}.\"\n  exit 1\nfi\n\ndockerfile=\"${{ inputs.docker_context }}/Dockerfile\"\nif [ -n \"${{ inputs.dockerfile }}\" ]; then\n  dockerfile=\"${{ inputs.dockerfile }}\"\nfi\n\nif [ ! -f \"$dockerfile\" ]; then\necho \"::error ::Dockerfile not found: $dockerfile. Do you need to prepend context or working directory?\"\n  exit 1\nfi\n\necho \"DOCKERFILE=$dockerfile\" \u003e\u003e $GITHUB_OUTPUT\n\nsuffix=\"${{ inputs.image_suffix }}\"\nsuffix=${suffix:+-$suffix} # Ensure we only add a dash if suffix is set\nrepo_name=\"${GITHUB_REPOSITORY/$GITHUB_REPOSITORY_OWNER\\//}$suffix\"\nrepo_name=\"$(tr '[:upper:]' '[:lower:]' \u003c\u003c\u003c \"$repo_name\")\"\necho \"REPO_NAME=$repo_name\" \u003e\u003e $GITHUB_OUTPUT\n"},{"name":"Docker meta","id":"meta","uses":"docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302","with":{"images":"${{ steps.login.outputs.registry }}/${{ steps.setup.outputs.REPO_NAME }}\n","tags":"type=sha,prefix={{date 'YYYY.MM.DD-HH.mm'}}-,priority=9002\ntype=raw,enable=${{ inputs.tag != '' }},value=${{ inputs.tag }},priority=9001\n"}},{"name":"Build and push","uses":"docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc","id":"build_push","with":{"context":"${{ inputs.docker_context }}","file":"${{ steps.setup.outputs.DOCKERFILE }}","push":"${{ inputs.push_image }}","pull":"${{ inputs.pull }}","tags":"${{ steps.meta.outputs.tags }}","labels":"${{ steps.meta.outputs.labels }}","cache-from":"${{ inputs.no_cache != 'true' \u0026\u0026 inputs.cache_from || '' }}","cache-to":"${{ inputs.no_cache != 'true' \u0026\u0026 inputs.cache_to || '' }}","no-cache":"${{ inputs.no_cache }}","build-args":"${{ inputs.build_args }}","secrets":"${{ inputs.build_secrets }}","platforms":"${{ inputs.platforms }}","target":"${{ inputs.target }}","outputs":"${{ inputs.outputs }}"}},{"name":"Check for errors","if":"${{ failure() \u0026\u0026 steps.build_push.outcome == 'failure' }}","shell":"bash","run":"echo \"::error ::Failed during image build. Is your docker_context set to where your build files are?\"\nexit 1\n"},{"name":"Build canonical image ref","shell":"bash","id":"image-ref","env":{"IMAGE_TAGS":"${{ steps.meta.outputs.tags }}","IMAGE_DIGEST":"${{ steps.build_push.outputs.digest }}","PUSH_IMAGE":"${{ inputs.push_image }}","SALSA":"${{ inputs.salsa }}"},"run":"set -euo pipefail\n\nimage=\"${IMAGE_TAGS%%$'\\n'*}\"\ndigest=\"${IMAGE_DIGEST#@}\"\n\nif [ -z \"$image\" ]; then\n  echo \"::error ::Failed to resolve image tag from docker metadata output. Expected steps.meta.outputs.tags to contain at least one image tag.\"\n  exit 1\nfi\n\nif [[ \"$image\" == *\"@\"* ]] \u0026\u0026 [ -n \"$digest\" ]; then\n  echo \"::error ::Image tag must not include a digest when digest is provided separately.\"\n  exit 1\nfi\n\nif [ \"$PUSH_IMAGE\" = 'true' ] \u0026\u0026 [ \"$SALSA\" = 'true' ] \u0026\u0026 [ -z \"$digest\" ]; then\n  echo \"::error ::Failed to resolve image digest from docker build output. Digest is required when push_image=true and salsa=true.\"\n  exit 1\nfi\n\nimage_ref=\"$image\"\n\nif [ \"$PUSH_IMAGE\" = 'true' ] \u0026\u0026 [ -n \"$digest\" ]; then\n  image_ref=\"$image@$digest\"\nfi\n\necho \"image=$image_ref\" \u003e\u003e \"$GITHUB_OUTPUT\"\n"},{"name":"Generate SBOM, attest and sign image","if":"${{ inputs.push_image == 'true' \u0026\u0026 inputs.salsa == 'true' }}","id":"attest-sign","uses":"nais/attest-sign@c778867caf15ed06f2893afd5723898560b2dcc9","with":{"image_ref":"${{ steps.image-ref.outputs.image }}","sbom":"${{ inputs.byosbom }}","additional_sboms":"${{ inputs.additional_sboms }}"}},{"name":"Set outputs","shell":"bash","id":"set-outputs","env":{"IMAGE":"${{ steps.image-ref.outputs.image }}","DIGEST":"${{ steps.build_push.outputs.digest }}","NEW_VERSION":"${{ steps.meta.outputs.version }}","SALSA_OUTPUT":"${{ steps.attest-sign.outputs.sbom }}"},"run":"set -euo pipefail\n\necho \"new_version=$NEW_VERSION\" \u003e\u003e \"$GITHUB_OUTPUT\"\necho \"image=$IMAGE\" \u003e\u003e \"$GITHUB_OUTPUT\"\necho \"digest=$DIGEST\" \u003e\u003e \"$GITHUB_OUTPUT\"\necho \"salsa=$SALSA_OUTPUT\" \u003e\u003e \"$GITHUB_OUTPUT\"\n"}]},"default_branch":"main","path":null},"repo_metadata":{"id":98303439,"uuid":"590934741","full_name":"nais/docker-build-push","owner":"nais","description":null,"archived":false,"fork":false,"pushed_at":"2026-09-23T07:27:14.000Z","size":171,"stargazers_count":0,"open_issues_count":1,"forks_count":6,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-09-26T14:16:34.512Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"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/nais.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"claude":null,"gemini":null,"cursor":null,"copilot":null,"dco":null,"cla":null,"disclosure":null}},"created_at":"2023-01-19T14:59:14.000Z","updated_at":"2026-09-23T07:18:45.000Z","dependencies_parsed_at":"2026-08-19T03:45:15.994Z","dependency_job_id":null,"html_url":"https://github.com/nais/docker-build-push","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/nais/docker-build-push","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nais%2Fdocker-build-push","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nais%2Fdocker-build-push/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nais%2Fdocker-build-push/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nais%2Fdocker-build-push/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nais","download_url":"https://codeload.github.com/nais/docker-build-push/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nais%2Fdocker-build-push/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":341189360,"owners_count":37722629,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-08-22T15:14:58.755Z","status":"online","status_checked_at":"2026-09-26T02:00:06.440Z","response_time":102,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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"},"owner_record":{"login":"nais","name":"nais","uuid":"29488289","kind":"organization","description":"NAV Application Infrastructure Service","email":null,"website":"https://nais.io","location":"Norway","twitter":null,"company":null,"icon_url":"https://avatars.githubusercontent.com/u/29488289?v=4","repositories_count":81,"last_synced_at":"2023-03-02T19:20:36.465Z","metadata":{"has_sponsors_listing":false},"html_url":"https://github.com/nais","funding_links":[],"total_stars":null,"followers":null,"following":null,"created_at":"2022-11-13T10:03:32.295Z","updated_at":"2023-03-02T19:20:36.494Z","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nais","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nais/repositories"},"tags":[{"name":"v0","sha":"423a915c9b72edf2ba848b88171ccb0489e2a40a","kind":"commit","published_at":"2026-09-23T07:18:40.000Z","download_url":"https://codeload.github.com/nais/docker-build-push/tar.gz/v0","html_url":"https://github.com/nais/docker-build-push/releases/tag/v0","dependencies_parsed_at":null,"dependency_job_id":"52fc7fbe-54d6-401d-a012-1a2efda0fe58","purl":"pkg:github/nais/docker-build-push@v0","tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nais%2Fdocker-build-push/tags/v0","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nais%2Fdocker-build-push/tags/v0/manifests"}]},"repo_metadata_updated_at":"2026-09-26T17:07:50.042Z","dependent_packages_count":0,"downloads":null,"downloads_period":null,"dependent_repos_count":0,"rankings":{"downloads":null,"dependent_repos_count":24.61104568276204,"dependent_packages_count":0.0,"stargazers_count":28.689642347982396,"forks_count":7.066261699621893,"docker_downloads_count":null,"average":15.091737432591582},"purl":"pkg:githubactions/nais/docker-build-push","advisories":[],"docker_usage_url":"https://docker.ecosyste.ms/usage/actions/nais/docker-build-push","docker_dependents_count":null,"docker_downloads_count":null,"usage_url":"https://repos.ecosyste.ms/usage/actions/nais/docker-build-push","dependent_repositories_url":"https://repos.ecosyste.ms/api/v1/usage/actions/nais/docker-build-push/dependencies","status":null,"funding_links":[],"critical":null,"issue_metadata":{"last_synced_at":"2026-09-26T10:41:44.451Z","issues_count":7,"pull_requests_count":95,"avg_time_to_close_issue":12466215.42857143,"avg_time_to_close_pull_request":1728651.9294117647,"issues_closed_count":7,"pull_requests_closed_count":85,"pull_request_authors_count":13,"issue_authors_count":6,"avg_comments_per_issue":1.7142857142857142,"avg_comments_per_pull_request":0.5789473684210527,"merged_pull_requests_count":49,"bot_issues_count":0,"bot_pull_requests_count":65,"past_year_issues_count":0,"past_year_pull_requests_count":23,"past_year_avg_time_to_close_issue":null,"past_year_avg_time_to_close_pull_request":876290.9090909091,"past_year_issues_closed_count":0,"past_year_pull_requests_closed_count":22,"past_year_pull_request_authors_count":3,"past_year_issue_authors_count":0,"past_year_avg_comments_per_issue":null,"past_year_avg_comments_per_pull_request":0.43478260869565216,"past_year_bot_issues_count":0,"past_year_bot_pull_requests_count":16,"past_year_merged_pull_requests_count":13,"issues_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/repositories/nais%2Fdocker-build-push/issues","maintainers":[{"login":"jksolbakken","count":1,"url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors/jksolbakken"}],"active_maintainers":[]},"versions_url":"https://packages.ecosyste.ms/api/v1/registries/github%20actions/packages/nais%2Fdocker-build-push/versions","version_numbers_url":"https://packages.ecosyste.ms/api/v1/registries/github%20actions/packages/nais%2Fdocker-build-push/version_numbers","latest_version_url":"https://packages.ecosyste.ms/api/v1/registries/github%20actions/packages/nais%2Fdocker-build-push/latest_version","dependent_packages_url":"https://packages.ecosyste.ms/api/v1/registries/github%20actions/packages/nais%2Fdocker-build-push/dependent_packages","related_packages_url":"https://packages.ecosyste.ms/api/v1/registries/github%20actions/packages/nais%2Fdocker-build-push/related_packages","codemeta_url":"https://packages.ecosyste.ms/api/v1/registries/github%20actions/packages/nais%2Fdocker-build-push/codemeta","maintainers":[]}