All Projects → jerray → publish-docker-action

jerray / publish-docker-action

Licence: MIT license
GitHub Action used to build, tag and publish docker image to your docker registry

Programming Languages

go
31211 projects - #10 most used programming language
shell
77523 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to publish-docker-action

iOSDC2020-Talk-Sample
iOSDC 2020「GitHub ActionsでiOSアプリをCIする個人的ベストプラクティス」レギュラートークのサンプルリポジトリ
Stars: ✭ 35 (+12.9%)
Mutual labels:  github-actions
dotnet-format
A GitHub Action to run dotnet-format as part of your workflow
Stars: ✭ 25 (-19.35%)
Mutual labels:  github-actions
mc-publish
GitHub Action that helps you publish your Minecraft mods
Stars: ✭ 76 (+145.16%)
Mutual labels:  github-actions
Real Time Social Media Mining
DevOps pipeline for Real Time Social/Web Mining
Stars: ✭ 22 (-29.03%)
Mutual labels:  github-actions
actions-clever-cloud
GitHub Action to deploy to Clever Cloud
Stars: ✭ 32 (+3.23%)
Mutual labels:  github-actions
cfn-deploy
A useful GitHub Action to help you deploy cloudformation templates
Stars: ✭ 14 (-54.84%)
Mutual labels:  github-actions
maven-settings-xml-action
Github Action to create maven settings (~/.m2/settings.xml)
Stars: ✭ 48 (+54.84%)
Mutual labels:  github-actions
actions-js-build
GitHub Actions for running Javascript build tools and committing file changes
Stars: ✭ 46 (+48.39%)
Mutual labels:  github-actions
actions-NjuHealthReport
Github Actions: 完成每日健康填报打卡,So easy
Stars: ✭ 68 (+119.35%)
Mutual labels:  github-actions
changelog-generator
GitHub Action to generate changelogs, release notes, whatever
Stars: ✭ 95 (+206.45%)
Mutual labels:  github-actions
push-package-action
| Public | GitHub Action to Push a Package to Octopus Deploy
Stars: ✭ 23 (-25.81%)
Mutual labels:  github-actions
action-dotenv-linter
GitHub Action to run dotenv-linter ⚡️
Stars: ✭ 14 (-54.84%)
Mutual labels:  github-actions
verify-linked-issue-action
A GitHub action that verifies your pull request contains a reference to an issue.
Stars: ✭ 18 (-41.94%)
Mutual labels:  github-actions
assign-author
GitHub Actions to assign author to issue or PR
Stars: ✭ 55 (+77.42%)
Mutual labels:  github-actions
ci-skip
CI skip comment
Stars: ✭ 35 (+12.9%)
Mutual labels:  github-actions
ghaction-cmake
cmake swiss army knife github docker action
Stars: ✭ 19 (-38.71%)
Mutual labels:  github-actions
portfolio
Site built from fastpages: https://fastpages.fast.ai/. Deployed here 👉
Stars: ✭ 16 (-48.39%)
Mutual labels:  github-actions
setup-graalvm
No description or website provided.
Stars: ✭ 63 (+103.23%)
Mutual labels:  github-actions
DemoApp
An Android template project for fast development and test.
Stars: ✭ 33 (+6.45%)
Mutual labels:  github-actions
zhiiiyang
It is a self-updating personal README showing my latest tweet and reply.
Stars: ✭ 27 (-12.9%)
Mutual labels:  github-actions

Publish Docker Action

GitHub Action codecov GitHub release (latest SemVer) Docker Pulls

Publish Docker Action builds, creates tags and pushes docker image to your docker registry.

Usage

This simple example uses Dockerfile in your workspace to build image, attach the latest tag and push to docker default registry (docker.io). Repository name is your GitHub repository name by default.

- uses: jerray/publish-docker-action@master
  with:
    username: ${{ secrets.DOCKER_USERNAME }}
    password: ${{ secrets.DOCKER_PASSWORD }}

Use file and path arguments to set docker build file or build context if they are not in the default workspace.

Set up registry and repository name

You can set docker registry with registry argument. Change docker repository name with repository argument. For example:

- uses: jerray/publish-docker-action@master
  with:
    username: ${{ secrets.DOCKER_USERNAME }}
    password: ${{ secrets.DOCKER_PASSWORD }}
    registry: docker.pkg.github.com
    repository: jerray/publish-docker-action

This will build and push the tag docker.pkg.github.com/jerray/publish-docker-action:latest.

Tags

Static Tag List

You can use static tag list by providing tags argument. Concat multiple tag names with commas.

- uses: jerray/publish-docker-action@master
  with:
    username: ${{ secrets.DOCKER_USERNAME }}
    password: ${{ secrets.DOCKER_PASSWORD }}
    registry: docker.pkg.github.com
    repository: jerray/publish-docker-action
    tags: latest,newest,master

This example builds the image, creates three tags, and pushes all of them to the registry.

  • docker.pkg.github.com/jerray/publish-docker-action:latest
  • docker.pkg.github.com/jerray/publish-docker-action:newest
  • docker.pkg.github.com/jerray/publish-docker-action:master

Auto Tag

Set with.auto_tag: true to allow action generate docker image tags automatically.

- uses: jerray/publish-docker-action@master
  with:
    username: ${{ secrets.DOCKER_USERNAME }}
    password: ${{ secrets.DOCKER_PASSWORD }}
    registry: docker.pkg.github.com
    repository: jerray/publish-docker-action
    auto_tag: true

Generated tags vary with refs types:

  • branch: uses the branch name as docker tag name (master branch is renamed to latest).
  • pull request: attaches a pr- prefix to branch name asdocker image tag. To allow pull request build, you must set with.allow_pull_request to true.
  • tag: checks if the tag name is valid semantic version format (prefix v is allowed). If not, it uses git tag name as docker image tag directly. Else it generates three tags based on the version number, each followed with pre-release information.

Examples:

Git Docker Tag
branch master latest
branch 2019/09/28-new-feature 2019-09-28-new-feature (/ is replaced to -)
pull request master pr-master
tag 1.0.0 1, 1.0, 1.0.0
tag v1.0.0 1, 1.0, 1.0.0
tag v1.0.0-rc1 1-rc1, 1.0-rc1, 1.0.0-rc1
tag 20190921-actions 20190921-actions (not semantic version)

Auto tagging will override with.tags list.

Additionally, there's an output value tag you can use in your next steps.

- id: build
  uses: jerray/publish-docker-action@master
  with:
    username: ${{ secrets.DOCKER_USERNAME }}
    password: ${{ secrets.DOCKER_PASSWORD }}
    registry: docker.pkg.github.com
    repository: jerray/publish-docker-action
    auto_tag: true

- id: deploy
  env:
    NEW_VERSION: ${{ steps.build.outputs.tag }}
  run: |
    docker pull $NEW_VERSION

Cache

Provide with.cache argument to build from cache.

Build Args

Use with.build_args to provide docker build-time variables. Multiple variables must be separated by comma.

- uses: jerray/publish-docker-action@master
  with:
    username: ${{ secrets.DOCKER_USERNAME }}
    password: ${{ secrets.DOCKER_PASSWORD }}
    registry: docker.pkg.github.com
    repository: jerray/publish-docker-action
    build_args: HTTP_PROXY=http://127.0.0.1,USER=nginx

Target for Multi-Stage Builds

Provide with.target argument to set --target flag for docker build.

Note

Please use the latest released version rather than master.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].