{"id":13822908,"url":"https://github.com/VaultVulp/gp-docker-action","last_synced_at":"2025-05-16T17:32:36.674Z","repository":{"id":45431710,"uuid":"231101533","full_name":"VaultVulp/gp-docker-action","owner":"VaultVulp","description":"GitHub Action to build and publish Docker Images to GitHub Container Registry","archived":false,"fork":false,"pushed_at":"2024-05-07T05:46:23.000Z","size":84,"stargazers_count":58,"open_issues_count":1,"forks_count":36,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2024-07-18T12:14:07.443Z","etag":null,"topics":["actions","docker","docker-image","github-actions","hacktoberfest","registry"],"latest_commit_sha":null,"homepage":"","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/VaultVulp.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":"2019-12-31T14:21:11.000Z","updated_at":"2024-05-07T05:42:30.000Z","dependencies_parsed_at":"2024-06-18T14:02:38.905Z","dependency_job_id":null,"html_url":"https://github.com/VaultVulp/gp-docker-action","commit_stats":{"total_commits":91,"total_committers":7,"mean_commits":13.0,"dds":"0.21978021978021978","last_synced_commit":"38ebcec449f7d8e81a3e42be7fcfeb840b78e03b"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VaultVulp%2Fgp-docker-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VaultVulp%2Fgp-docker-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VaultVulp%2Fgp-docker-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VaultVulp%2Fgp-docker-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VaultVulp","download_url":"https://codeload.github.com/VaultVulp/gp-docker-action/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":213893313,"owners_count":15653524,"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","docker","docker-image","github-actions","hacktoberfest","registry"],"created_at":"2024-08-04T08:02:24.070Z","updated_at":"2024-08-04T08:09:13.667Z","avatar_url":"https://github.com/VaultVulp.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"# GitHub Action to build and publish Docker Images to GitHub Container registry\n\n## Usage examples:\n\n### Build and publish Docker Image with the `head` tag for the `develop` branch\n\n#### Complete workflow example\n```yaml\nname: Build and publish\n\non: \n  push:\n    branches:\n    - \"develop\" # Running this workflow only for develop branch\n\njobs:\n  build-and-publish-head:\n    runs-on: ubuntu-latest\n\n    steps:\n    - uses: actions/checkout@v2.5.0 # Checking out the repo\n\n    - name: Build and publish \"head\" Docker image\n      uses: VaultVulp/gp-docker-action@1.6.0\n      with:\n        github-token: ${{ secrets.GITHUB_TOKEN }} # Provide GITHUB_TOKEN to login into the GitHub Packages\n        image-name: my-cool-service # Provide Docker image name\n        image-tag: head # Provide Docker image tag\n```\n\n### Build and publish Docker Image with a `latest` tag for the `master` branch with different dockerfile\n\n#### Complete workflow example\n```yaml\nname: Build and publish\n\non: \n  push:\n    branches:\n    - \"master\" # Running this workflow only for master branch\n\njobs:\n  build-and-publish-latest:\n    runs-on: ubuntu-latest\n\n    steps:\n    - uses: actions/checkout@v2.5.0 # Checking out the repo\n\n    - name: Build and publish \"latest\" Docker image\n      uses: VaultVulp/gp-docker-action@1.6.0\n      with:\n        github-token: ${{ secrets.GITHUB_TOKEN }} # Provide GITHUB_TOKEN to login into the GitHub Packages\n        image-name: my-cool-service # Provide only Docker image name, tag will be automatically set to latest\n        dockerfile: Alternative.Dockerfile # Provide custom Dockerfile name\n```\n\n### Build and publish Docker Image with a tag equal to a git tag\n\n#### Complete workflow example\n```yaml\nname: Build and publish\n\non: \n  push:\n    tags:\n    - \"*\" # Running this workflow for any tag\n\njobs:\n  build-and-publish-tag:\n    runs-on: ubuntu-latest\n\n    steps:\n    - uses: actions/checkout@v2.5.0 # Checking out the repo\n    \n    - name: Build and publish Docker image tagged according to a git-tag\n      uses: VaultVulp/gp-docker-action@1.6.0\n      with:\n        github-token: ${{ secrets.GITHUB_TOKEN }} # Provide GITHUB_TOKEN to login into the GitHub Packages\n        image-name: my-cool-service # Provide only Docker image name\n        extract-git-tag: true # Provide flag to extract Docker image tag from git reference\n```\n\n### Build and publish Docker Image with a different build context\n\n#### Complete workflow example\n```yaml\nname: Build and publish\n\non: push\n\njobs:\n  build-and-publish-context:\n    runs-on: ubuntu-latest\n\n    steps:\n    - uses: actions/checkout@v2.5.0 # Checking out the repo\n    \n    - name: Build and publish Docker image from a different context\n      uses: VaultVulp/gp-docker-action@1.6.0\n      with:\n        github-token: ${{ secrets.GITHUB_TOKEN }} # Provide GITHUB_TOKEN to login into the GitHub Packages\n        image-name: my-cool-service # Provide Docker image name\n        build-context: ./dev # Provide path to the folder with a Dockerfile\n```\n\n### Pulling an image before building it\n\n#### Complete workflow example\n```yaml\nname: Build and publish\n\non: push\n\njobs:\n  pull-and-build-and-publish:\n    runs-on: ubuntu-latest\n\n    steps:\n    - uses: actions/checkout@v2.5.0 # Checking out the repo\n\n    - name: Pull, build and publish Docker image\n      uses: VaultVulp/gp-docker-action@1.6.0\n      with:\n        github-token: ${{ secrets.GITHUB_TOKEN }} # Provide GITHUB_TOKEN to login into the GitHub Packages\n        image-name: my-cool-service # Provide Docker image name\n        pull-image: true # Provide the flag to pull image\n```\n\n### Passing additional image tags\n\n**NB**, `additional-image-tags` will **not** replace `image-tag` argument - additional tags will be appended to the list. If no `image-tag` was specified, then image will be tagged with the `latest` tag.\n\n#### Examples\n\n##### `image-tag` was specified: \n```yaml\nimage-name: my-cool-service\nimage-tags: first\nadditional-image-tags: second third\n```\nAction will produce one image with three tags:\n- `my-cool-service:first`\n- `my-cool-service:second`\n- `my-cool-service:third`\n\n##### No `image-tag` was specified: \n\nIn this case action will use the default `latest` tag.\n\n```yaml\nimage-name: my-cool-service\nadditional-image-tags: second third\n```\nAction will produce one image with three tags:\n- `my-cool-service:latest`\n- `my-cool-service:second`\n- `my-cool-service:third`\n\n#### Complete workflow example\n```yaml\nname: Build and publish \n\non: push\n\njobs:\n  build-with-multiple-tags:\n    runs-on: ubuntu-latest\n\n    steps:\n    - uses: actions/checkout@v2.5.0 # Checking out the repo\n \n    - name: Build and publish Docker image with multiple tags\n      uses: VaultVulp/gp-docker-action@1.6.0\n      with:\n        github-token: ${{ secrets.GITHUB_TOKEN }} # Provide GITHUB_TOKEN to login into the GitHub Packages\n        image-name: my-cool-service # Provide Docker image name\n        image-tags: first # if ommitted will be replaced with \"latest\"\n        additional-image-tags: second third # two additional tags for an image\n```\n\n### Cross-platform builds\n\nIt's possible to leverage `custom-args` to build images for different architectures.\n\n#### Examples\n##### One architeture\n```yaml\ncustom-args: --platform=linux/arm64 # target architecture\n```\n##### Multiple architetures\n```yaml\ncustom-args: --platform=linux/arm64,linux/amd64 # multiple target architectures\n```\n\n#### Complete workflow example\n```yaml\nname: Build and publish\n\non: push\n\njobs:\n  cross-platform-builds:\n    runs-on: ubuntu-latest\n\n    steps:\n    - uses: actions/checkout@v2.5.0 # Checking out the repo\n \n    - name: Build and publish Docker image for ARM64 and AMD64 architectures at the same time\n      uses: VaultVulp/gp-docker-action@1.6.0\n      with:\n        github-token: ${{ secrets.GITHUB_TOKEN }} # Provide GITHUB_TOKEN to login into the GitHub Packages\n        image-name: my-cool-service # Provide Docker image name\n        custom-args: --platform=linux/arm64,linux/amd64 # specify target architectures via the `custom-args` agrument\n```\n\n### Passing additional arguments to the docker build command\n\n**NB**, additional arguments should be passed with the `=` sign istead of a ` `(space) between argument name and values.\n\nCorrect example: \n```yaml\ncustom-args: --build-arg=some=\"value\" \n                      # ^ this \"=\" is mandatory\n```\nIncorrect example:\n```yaml\ncustom-args: --build-arg some=\"value\" \n                      # ^ this space might break the action\n```\n\n#### Complete workflow example\n```yaml\nname: Build and publish\n\non: push\n\njobs:\n  build-with-custom-args:\n    runs-on: ubuntu-latest\n\n    steps:\n    - uses: actions/checkout@v2.5.0 # Checking out the repo\n \n    - name: Build and publish Docker image with arbitrary --build-arg(s)\n      uses: VaultVulp/gp-docker-action@1.6.0\n      with:\n        github-token: ${{ secrets.GITHUB_TOKEN }} # Provide GITHUB_TOKEN to login into the GitHub Packages\n        image-name: my-cool-service # Provide Docker image name\n        custom-args: --build-arg=some=\"value\" --build-arg=some_other=\"value\" # Pass some additional arguments to the docker build command\n```\n\n## My own repo with examples\n\n[VaultVulp/test-gp-docker-action](https://github.com/VaultVulp/test-gp-docker-action)\n\n## Security considerations\n\nYou will encounter the following log message in your GitHub Actions Pipelines:\n\n```\nWARNING! Using --password via the CLI is insecure. Use --password-stdin.\nWARNING! Your password will be stored unencrypted in /github/home/.docker/config.json.\nLogin Succeeded\n```\n\nI would like to ensure you, that I do not store your secrets, passwords, token, or any other information.\n\nThis warning informs you about the fact, that this Action passes your GitHub token via the command line argument:\n```bash\ndocker login -u publisher -p ${DOCKER_TOKEN} ghcr.io\n```\n\nIn a non-safe environment, this could raise a security issue, but this is not the case. We are passing a temporary authorization token, which will expire once the pipeline is completed. It would also require additional code to extract this token from the environment or `docker` internals, that this Action does not have.\n\n[This](https://docs.github.com/en/packages/managing-github-packages-using-github-actions-workflows/publishing-and-installing-a-package-with-github-actions#upgrading-a-workflow-that-accesses-a-registry-using-a-personal-access-token\n) is the detailed explanation about the `${{ secrets.GITHUB_TOKEN }}` and it's relations with the GCR.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FVaultVulp%2Fgp-docker-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FVaultVulp%2Fgp-docker-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FVaultVulp%2Fgp-docker-action/lists"}