Giter VIP home page Giter VIP logo

docker-tag-build-push-action's Introduction

GitHub release GitHub marketplace CI workflow

About

A composite action to tag, build, and optionally login and push a docker image to a registry.

This action basically chains calls to the following popular actions with some common defaults.


Usage

Basic

Push to ghcr.io by default

name: Docker

on:
  push:
    branches:
      - main
    tags:
      - 'v*.*.*'
  pull_request:

jobs:
  docker:
    runs-on: ubuntu-latest
    steps:
      - uses: benfrisbie/docker-tag-build-push-action@v1

Push to Docker Hub

name: Docker

on:
  push:
    branches:
      - main
    tags:
      - 'v*.*.*'
  pull_request:

jobs:
  docker:
    runs-on: ubuntu-latest
    steps:
      - uses: benfrisbie/docker-tag-build-push-action@v1
        with:
            images: docker.io/${{ github.repository }}
            registry: 'docker.io'
            username: ${{ secrets.DOCKERHUB_USERNAME }}
            password: ${{ secrets.DOCKERHUB_TOKEN }}

Push to Multiple Registries

Push to Docker Hub and ghcr.io. First login to docker.io and the automatically login to ghcr.io by default.

name: Docker

on:
  push:
    branches:
      - main
    tags:
      - 'v*.*.*'
  pull_request:

jobs:
  docker:
    runs-on: ubuntu-latest
    steps:
      - uses: docker/login-action@v2
        with:
            registry: 'docker.io'
            username: ${{ secrets.DOCKERHUB_USERNAME }}
            password: ${{ secrets.DOCKERHUB_TOKEN }}
      - uses: benfrisbie/docker-tag-build-push-action@v1
        with:
            images: |
                docker.io/${{ github.repository }}
                ghcr.io/${{ github.repository }}

Inputs

The inputs are the same as the ones defined in:

Defaults

In an attempt to make this action easier to use, the following defaults are set:

  • Build an image named ghcr.io/${{ github.repository }}
  • The image tags are determined based on the event causing the build as defined at docker/metadata-action#tags-input
  • Push image to registry on git push events ${{ github.event_name == 'push' }}
  • Default registry of ghcr.io
    • Username = ${{ github.actor }}
    • Password = ${{ github.token }}

Outputs

The outputs are the same as the ones defined in:

docker-tag-build-push-action's People

Contributors

benfrisbie avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

docker-tag-build-push-action's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.