mirror of
https://github.com/docker/login-action.git
synced 2024-11-24 08:05:06 +08:00
Add examples for GitLab and GitHub Package Registry
This commit is contained in:
parent
c252382ab9
commit
161192d780
61
README.md
61
README.md
@ -15,6 +15,9 @@ If you are interested, [check out](https://git.io/Je09Y) my other :octocat: GitH
|
|||||||
___
|
___
|
||||||
|
|
||||||
* [Usage](#usage)
|
* [Usage](#usage)
|
||||||
|
* [DockerHub](#dockerhub)
|
||||||
|
* [GitHub Package Registry](#github-package-registry)
|
||||||
|
* [GitLab](#gitlab)
|
||||||
* [Customizing](#customizing)
|
* [Customizing](#customizing)
|
||||||
* [inputs](#inputs)
|
* [inputs](#inputs)
|
||||||
* [Limitation](#limitation)
|
* [Limitation](#limitation)
|
||||||
@ -23,6 +26,8 @@ ___
|
|||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
### DockerHub
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
name: ci
|
name: ci
|
||||||
|
|
||||||
@ -42,8 +47,60 @@ jobs:
|
|||||||
name: Login to DockerHub
|
name: Login to DockerHub
|
||||||
uses: crazy-max/ghaction-docker-login@v1
|
uses: crazy-max/ghaction-docker-login@v1
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
|
```
|
||||||
|
|
||||||
|
### GitHub Package Registry
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
name: ci
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: master
|
||||||
|
tags:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
login:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
-
|
||||||
|
name: Login to DockerHub
|
||||||
|
uses: crazy-max/ghaction-docker-login@v1
|
||||||
|
with:
|
||||||
|
registry: docker.pkg.github.com
|
||||||
|
username: ${{ github.repository_owner }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
```
|
||||||
|
|
||||||
|
### GitLab
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
name: ci
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: master
|
||||||
|
tags:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
login:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
-
|
||||||
|
name: Login to GitLab
|
||||||
|
uses: crazy-max/ghaction-docker-login@v1
|
||||||
|
with:
|
||||||
|
registry: registry.gitlab.com
|
||||||
|
username: ${{ secrets.GITLAB_USERNAME }}
|
||||||
|
password: ${{ secrets.GITLAB_PASSWORD }}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Customizing
|
## Customizing
|
||||||
|
Loading…
Reference in New Issue
Block a user