GithubHelp home page GithubHelp logo

acr-login's Introduction

Log in to a container registry

Use this GitHub Action to log in to a private container registry of Alibaba Cloud Container Registry. Once login is done, the next set of actions in the workflow can perform tasks such as building, tagging and pushing containers.

- uses: aliyun/acr-login@v1
  with:
    login-server: '<login server>' # default: https://index.docker.io/v1/
    username: '<username>'
    password: '<password>'

Or

- uses: aliyun/acr-login@v1
  with:
    region-id: '<region id>' # example: cn-hangzhou
    access-key-id: '<access key id>'
    access-key-secret: '<access key secret>'

Or

- uses: aliyun/acr-login@v1
  with:
    login-server: '<login server>' # example: https://my-test-registry.cn-hangzhou.cr.aliyuncs.com
    region-id: '<region id>' # example: cn-hangzhou
    access-key-id: '<access key id>'
    access-key-secret: '<access key secret>'
    instance-id: '<registry instance id>'

Refer to the action metadata file for details about all the inputs: action.yml

You can build and push container registry by using the following example

- name: Login to ACR
  uses: aliyun/acr-login@v1
  with:
    login-server: https://registry.cn-hangzhou.aliyuncs.com
    username: "${{ secrets.REGISTRY_USERNAME }}"
    password: "${{ secrets.REGISTRY_PASSWORD }}"
- name: Build and push image
  env:
    IMAGE_TAG: ${{ github.sha }}
  run: |
    docker build -t registry.cn-hangzhou.aliyuncs.com/myrepo/demo:$IMAGE_TAG .
    docker push registry.cn-hangzhou.aliyuncs.com/myrepo/demo:$IMAGE_TAG

Prerequisite

Get the username and password of your container registry or get the authentication token fo temporary access by access key.

Now add the username and password or access key as secrets in the GitHub repository.

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.