{"id":18800593,"url":"https://github.com/bitovi/github-actions-docker-publish","last_synced_at":"2025-04-13T17:31:23.930Z","repository":{"id":40227816,"uuid":"480978196","full_name":"bitovi/github-actions-docker-publish","owner":"bitovi","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-28T11:37:36.000Z","size":47,"stargazers_count":8,"open_issues_count":0,"forks_count":5,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-04-10T13:16:35.143Z","etag":null,"topics":["actions","github-actions"],"latest_commit_sha":null,"homepage":"","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/bitovi.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}},"created_at":"2022-04-12T21:27:40.000Z","updated_at":"2025-01-28T11:31:34.000Z","dependencies_parsed_at":"2024-02-06T15:52:34.739Z","dependency_job_id":null,"html_url":"https://github.com/bitovi/github-actions-docker-publish","commit_stats":{"total_commits":49,"total_committers":4,"mean_commits":12.25,"dds":"0.18367346938775508","last_synced_commit":"0ef09b3798407b7bfa05079884d489e53b8813c8"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitovi%2Fgithub-actions-docker-publish","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitovi%2Fgithub-actions-docker-publish/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitovi%2Fgithub-actions-docker-publish/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitovi%2Fgithub-actions-docker-publish/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitovi","download_url":"https://codeload.github.com/bitovi/github-actions-docker-publish/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248752386,"owners_count":21156081,"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":["actions","github-actions"],"created_at":"2024-11-07T22:19:15.098Z","updated_at":"2025-04-13T17:31:23.630Z","avatar_url":"https://github.com/bitovi.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker Build - Tag - Publish\n\nThis GitHub Action will build, tag, and publish your docker image.  The logic has been designed for our use case, but can be modifed for yours.\n\nThe image name will default to be the same as the GitHub Repo.  \n![alt](https://bitovi-gha-pixel-tracker-deployment-main.bitovi-sandbox.com/pixel/WxT-2qe0ZvLhbtpoNfVxv)\n# Default Tagging Logic\nThe tagging logic works as follows:\n1. If you have a value for `image_tag` then we will use that value.\n2. If you set `sha` to `true` then we will use the SHA\n3. If this is the default branch, then the tag will be `latest`\n4. if this is a pull request, the the tag will be `pr-branch` where branch is the branch name.\n5. Otherwise, we'll use the branch name or tag value.\n\n```mermaid\ngraph LR\n    A{value provided for image_tag} --\u003e|Yes| B[image_tag]\n    A --\u003e |No| C{SHA set to True} --\u003e |Yes| D[Use SHA]\n    C --\u003e |No| E{Default Branch} --\u003e |Yes| F[Latest]\n    E --\u003e |No| G{Pull Request} --\u003e |Yes| H[pr-branch where branch is the branch name]\n    G --\u003e |No| I[Use branch name]\n```\n\n### Inputs\n\nThe following can be used as `step.with` keys.  T/F types expect true or false.  Req is required.\n\n| Name             | Type    | Req | Description                  | Default |\n|------------------|---------|-----|------------------------------|---------|\n| `docker_username` | string | Yes | Dockerhub username | N/A |\n| `docker_password` | string | Yes | Dockerhub Password | N/A |\n| `checkout` | T/F | No | Determines if we should checkout the repository.  Set to `false` if this is being done in an eariler step | `true` |\n| `image_tag` | string | No | Use this tag instead of the tagging logic.  | See tagging logic |\n| `use_latest` | T/F | No | The default branch gets a latest tag | `true` |\n| `sha` | T/F | No | Set to `true` to use the SHA for the tag. | `false` |\n| `org_name` | string | No | Docker org name.   | GitHub Org Name |\n| `repo_name` | string | No | The name of the Docker Repository.  | GitHub repo name. |\n| `build_args` | string | No | Add arbitrary build arguments | N/A |\n| `working-directory` | string | No | Specifies the working directory for the Docker Build step | N/A |\n\n\n## Example 1\n\nThis will checkout the code, build, tag and push using the default tags. \n\n```yaml\n-   id: docker-publish\n    uses: bitovi/github-actions-docker-publish@main\n      with:\n        docker_username: ${{ secrets.DOCKERHUB_USERNAME }}\n        docker_password: ${{ secrets.DOCKERHUB_PASSWORD }}\n```\n\n## Example 2\n\nHere we check the code out since we make a change before the build / publish step.  We also show how to get the image and tag for later use in the same job.\n\n```yaml\n  steps:\n    - name: Checkout \n      uses: actions/checkout@v3\n    - name: do something to the code\n      run: echo \"Changed code\" \u003e text.txt\n    - id: docker-publish\n      name: Build image\n      uses: bitovi/github-actions-docker-publish@v1.0.3\n      with:\n        docker_username: ${{ secrets.DOCKERHUB_USERNAME }}\n        docker_password: ${{ secrets.DOCKERHUB_PASSWORD }}\n        checkout: 'false'\n        image_tag: it\n        sha: 'true' # won't do anything since image_tag is set\n        org_name: bitovi\n        repo_name: deploy-eks-helm\n        build_args: --build-arg git_personal_token=PAT_token\n        working-directory: ./app/inner-folder\n    - run: |\n        echo \"Image Created:  ${{ env.image }}\"\n        echo \"Tag Created: ${{ env.tag }}\"\n```\n\n## License\nThe scripts and documentation in this project are released under the [MIT License](https://github.com/bitovi/github-actions-docker-publish/blob/main/LICENSE).\n\n## Provided by Bitovi\n[Bitovi](https://www.bitovi.com/) is a proud supporter of Open Source software.\n\n## Customize\nPlease feel free to copy and customize this action for your specific use case, just give some credit to Bitovi as the orignal authors.  \n\n## Need help or have questions?\nYou can **get help or ask questions** on [Discord channel](https://discord.gg/zAHn4JBVcX)! Come hangout with us!\n\nOr, you can hire us for training, consulting, or development. [Set up a free consultation](https://www.bitovi.com/devops-consulting).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitovi%2Fgithub-actions-docker-publish","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitovi%2Fgithub-actions-docker-publish","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitovi%2Fgithub-actions-docker-publish/lists"}