{"id":13530232,"url":"https://github.com/docker-archive/github-actions","last_synced_at":"2025-09-30T15:30:51.358Z","repository":{"id":49236603,"uuid":"241092155","full_name":"docker/github-actions","owner":"docker","description":":warning: This repository is deprecated and has been replaced by docker/build-push-action@v2","archived":true,"fork":false,"pushed_at":"2021-06-22T13:05:39.000Z","size":99,"stargazers_count":163,"open_issues_count":0,"forks_count":40,"subscribers_count":43,"default_branch":"master","last_synced_at":"2024-09-18T13:49:04.394Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/docker.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}},"created_at":"2020-02-17T11:34:08.000Z","updated_at":"2024-01-04T16:42:17.000Z","dependencies_parsed_at":"2022-09-19T07:31:47.998Z","dependency_job_id":null,"html_url":"https://github.com/docker/github-actions","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docker%2Fgithub-actions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docker%2Fgithub-actions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docker%2Fgithub-actions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docker%2Fgithub-actions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/docker","download_url":"https://codeload.github.com/docker/github-actions/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219866160,"owners_count":16554208,"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":[],"created_at":"2024-08-01T07:00:46.359Z","updated_at":"2025-09-30T15:30:46.043Z","avatar_url":"https://github.com/docker.png","language":"Go","readme":"## Deprecated\n\nThis repository is being replaced with [docker/build-push-action@v2](https://github.com/docker/build-push-action/)\nwhich includes significant changes and now uses Docker [Buildx](https://github.com/docker/buildx). It will not receive\nany future updates, please update your workflows.\n\n[Upgrade notes](https://github.com/docker/build-push-action/blob/master/UPGRADE.md) with many [usage examples](https://github.com/docker/build-push-action/#advanced-usage)\nhave been added to handle most use cases.\n\n## About\n\nThe core code base for Docker's GitHub Actions (https://github.com/features/actions). This code is used to build the docker/github-actions image that provides the functionality used by the published Docker GitHub Action:\n\n* [Build and push Docker images action](https://github.com/docker/build-push-action)\n\n`github-actions` runs a command line tool that shells out to docker to perform the various functions. Parameters are supplied to `github-actions` using environment variables in the form described by the GitHub Actions documentation. `github-actions` uses some of the default GitHub Actions environment variables as described in the individual commands section.\n\n## Commands\n\nCommands can be called using `docker run docker/github-actions {command}`\n\n### login\n\nDoes a `docker login` using the supplied username and password. Will default to Docker Hub but can be supplied a server address to login to a third-party registry as required.\n\n#### inputs\n\n|Environment Variable|Required|Description|\n|---|---|---|\n|INPUT_USERNAME|yes|Username to login with|\n|INPUT_PASSWORD|yes|Password to login with|\n|INPUT_REGISTRY|no|Registry server to login to. Defaults to Docker Hub|\n\n### build\n\nBuilds and tags a docker image.\n\n#### inputs\n\n|Environment Variable|Required|Description|\n|---|---|---|\n|INPUT_PATH|yes|Path to build from|\n|INPUT_DOCKERFILE|no|Path to Dockerfile|\n|INPUT_ADD_GIT_LABELS|no|Adds git labels (see below)|\n|INPUT_TARGET|no|Target build stage to build|\n|INPUT_BUILD_ARGS|no|Comma-delimited list of build-args|\n|INPUT_LABELS|no|Comma-delimited list of labels|\n|INPUT_CACHE_FROMS|no|Comma-delimited list of cache-froms|\n\nSee the tagging section for information on tag inputs\n\n##### Git labels\n\nWhen `INPUT_ADD_GIT_LABELS` is `true` labels are automatically added to the image that contain data about the current state of the git repo based on the standards set out in https://github.com/opencontainers/image-spec/blob/master/annotations.md.\n\n3 labels are supported:\n\n|Label|Description|\n|---|---|\n|org.opencontainers.image.created|Date and time on which the image was built (string, date-time as defined by RFC 3339).|\n|org.opencontainers.image.source|URL to this repository. E.g. `https://github.com/myorg/myrepository`|\n|org.opencontainers.image.revision|The full git sha of this commit.|\n\n### push\n\nPushes a docker image.\n\n#### inputs\n\nSee the tagging section for information on tag inputs\n\n\n### build-push\n\nBuilds, logs in, and pushes a docker image.\n\n#### inputs\n\nSame as the login and build commands with the addition of\n\n|Environment Variable|Required|Description|\n|---|---|---|\n|INPUT_PUSH|no|Will push the image if true|\n\n\n## Tagging\n\nTagging of images can be set manually, left to `github-actions` to automate, or a combination of the both.\n\nThere are 4 input variables used for tagging\n\n|Environment Variable|Required|Description|\n|---|---|---|\n|INPUT_REGISTRY|no|Registry server to tag with|\n|INPUT_REPOSITORY|yes|Repository to tag with|\n|INPUT_TAGS|no|Hard coded comma-delimited list of tags|\n|INPUT_TAG_WITH_REF|no|If true then `github-actions` will add tags depending on the git ref automatically as described below|\n|INPUT_TAG_WITH_SHA|no|If true then `github-actions` will add a tag in the form `sha-{git-short-sha}`|\n\nIf `INPUT_REGISTRY` is set then all tags are prefixed with `{INPUT_REGISTRY}/{INPUT_REPOSITORY}:`.\nIf not then all tags are prefixed with `{INPUT_REPOSITORY}:`\n\nAuto tags depend on the git reference that the run is associated with. The reference is passed to `github-actions` using the GitHub actions `GITHUB_REF` enviroment variable.\n\nIf the reference is `refs/heads/{branch-name}` then the tag `{branch-name}` is added. For the master branch the `{branch-name}` is replaced with `latest`.\n\nIf the reference is `refs/pull/{pr}` then the tag `pr-{pr}` is added.\n\nIf the reference is `refs/tags/{tag-name}` then the tag `{tag-name}` is added.\n\nAny `/` in the auto tags are replaced with `-`.\n\nFor example if the environment variables are as follows:\n\n|Variable|Value|\n|---|---|\n|INPUT_REGISTRY||\n|INPUT_REPOSITORY|myorg/myimage|\n|INPUT_TAGS|foo,bar|\n|INPUT_TAG_WITH_REF|true|\n|GITHUB_REF|refs/tags/v0.1|\n\nThen the image will be tagged with:\n```\nmyorg/myimage:foo\nmyorg/myimage:bar\nmyorg/myimage:v0.1\n```\n\nIf the variables are as follows:\n\n|Variable|Value|\n|---|---|\n|INPUT_REGISTRY|myregistry|\n|INPUT_REPOSITORY|myorg/myimage|\n|INPUT_TAGS|foo,bar|\n|INPUT_TAG_WITH_REF|true|\n|INPUT_TAG_WITH_SHA|true|\n|GITHUB_REF|refs/heads/master|\n|GITHUB_SHA|c6df8c68eb71799f9c9ab4a4a4650d6aabd7e415|\n\nThen the image will be tagged with:\n```\nmyregistry/myorg/myimage:foo\nmyregistry/myorg/myimage:bar\nmyregistry/myorg/myimage:lastest\nmyregistry/myorg/myimage:sha-c6df8c6\n```\n\n## Building github-actions\nThe code is written in Go v1.13 with `go mod`. It can be built locally using the `Makefile` or in docker using the `docker.Makefile`.\n\n`make -f docker.Makefile` will build the code, check the linting using golangci-lint, run the go tests, and build the image with a tag of docker/github-actions:latest\n\n`make -f docker.Makefile image` will build the github-actions image without a tag and without running test or lint checking\n\n`make -f docker.Makefile cli` will build the cli and copy it to `./bin/github-actions`\n\n`make -f docker.Makefile test` will run the unit and e2e tests\n","funding_links":[],"categories":["Community Resources"],"sub_categories":["Collection of Actions"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdocker-archive%2Fgithub-actions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdocker-archive%2Fgithub-actions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdocker-archive%2Fgithub-actions/lists"}