mirror of
https://github.com/redhat-actions/podman-login.git
synced 2025-02-23 02:21:22 +01:00
adding ghcr.io login example (#1)
Add example of logging into github's container registry
This commit is contained in:
parent
22deeeef6a
commit
470f401e89
1 changed files with 28 additions and 1 deletions
29
README.md
29
README.md
|
@ -27,7 +27,7 @@ This action only runs on `Linux`, as it uses [podman](https://github.com/contain
|
||||||
| password | Password, encrypted password, or access token for `username`. | **Must be provided**
|
| password | Password, encrypted password, or access token for `username`. | **Must be provided**
|
||||||
| logout | By default, the action logs out of the container image registry at the end of the job (for self-hosted runners). Set this to `false` to disable this behaviour. | `true`
|
| logout | By default, the action logs out of the container image registry at the end of the job (for self-hosted runners). Set this to `false` to disable this behaviour. | `true`
|
||||||
|
|
||||||
## Example
|
## Examples
|
||||||
|
|
||||||
The example below shows how the `podman-login` action can be used to log in to `quay.io` container image registry.
|
The example below shows how the `podman-login` action can be used to log in to `quay.io` container image registry.
|
||||||
|
|
||||||
|
@ -56,3 +56,30 @@ jobs:
|
||||||
|
|
||||||
# Now you can push images, and pull private ones, from quay.io as 'quayuser'.
|
# Now you can push images, and pull private ones, from quay.io as 'quayuser'.
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Logging into `github`'s container registry is just as easy:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
name: Log in to ghcr.io
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
|
||||||
|
env:
|
||||||
|
REGISTRY_USER: ${{ github.actor }}
|
||||||
|
REGISTRY_PASSWORD: ${{ github.token }}
|
||||||
|
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
login:
|
||||||
|
name: Log in to GitHub Container Registry
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
steps:
|
||||||
|
- name: Log in to ghrc.io
|
||||||
|
uses: redhat-actions/podman-login@v1
|
||||||
|
with:
|
||||||
|
username: ${{ env.REGISTRY_USER }}
|
||||||
|
password: ${{ env.REGISTRY_PASSWORD }}
|
||||||
|
registry: ${{ env.IMAGE_REGISTRY }}
|
||||||
|
|
||||||
|
# Now you can push images, and pull private ones, from ghcr.io.
|
||||||
|
```
|
||||||
|
|
Loading…
Add table
Reference in a new issue