Coder Social home page Coder Social logo

shahulsonhal / tag-push-action Goto Github PK

View Code? Open in Web Editor NEW

This project forked from akhilerm/tag-push-action

0.0 0.0 0.0 447 KB

Github action to copy/retag multiarch images from one registry to another

License: MIT License

JavaScript 7.88% TypeScript 92.12%

tag-push-action's Introduction

tag-push-action

About

Github action to retag and push multiplatform images to multiple registries

๐Ÿ’ก See also:

The v1 version of this action heavily relied on work done by @tonistiigi.

The current version uses crane from google for copying images, and the action itself is a modified version of script written by @crazymax

Usage

Basic

name: Push-Image

on: push

jobs:
  push-image:
    runs-on: ubuntu-latest
    steps:

      - name: Login Quay
        uses: docker/login-action@v1
        with:
          registry: 'quay.io'
          username: ${{ secrets.QUAY_USERNAME }}
          password: ${{ secrets.QUAY_TOKEN }}

      - name: Login Dockerhub
        uses: docker/login-action@v1
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_TOKEN }}

      - name: Push image
        uses: akhilerm/[email protected]
        with:
          src: docker.io/akhilerm/node-disk-manager:ci
          dst: |
            quay.io/akhilerm/node-disk-manager-amd64:ci
  1. Login to all the registries from which you want to pull and push the multiplatform image.

  2. Specify the src and dst registry, both of which are mandatory fields. The action allows multiple destination registries specified as a yaml string.

NOTE: If dockerhub is used, make sure that docker.io is specified in the image name

Using with docker/metadata-action

The action can be used alongside metadata-action to generate tags easily.

name: Push-Image

on: push

jobs:
  push-image:
    runs-on: ubuntu-latest
    steps:

      - name: Login Dockerhub
        uses: docker/login-action@v1
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_TOKEN }}

      - name: Docker meta
        id: meta
        uses: docker/metadata-action@v3
        with:
          images: docker.io/akhilerm/node-disk-manager     

      - name: Push image
        uses: akhilerm/[email protected]
        with:
          src: docker.io/akhilerm/node-disk-manager:ci
          dst: |
            ${{ steps.meta.outputs.tags }}

The output tags from the meta step can be used as destination tags for this github action.

Use a custom docker config file

The standard docker config path on GitHub runner is /home/runner/.docker/config.json. In case you're running on a custom GitHub runner, and your config path is not standard, then the docker-config-path can be used.

  - name: Push image
    uses: akhilerm/[email protected]
    with:
      docker-config-path: /home/myuser/.docker/config.json
      src: docker.io/akhilerm/node-disk-manager:ci
      dst: |
        quay.io/akhilerm/node-disk-manager-amd64:ci

tag-push-action's People

Contributors

akhilerm avatar dependabot[bot] avatar rnsc avatar saniales avatar

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.