Sign in to an Open Container Initiative (OCI) registry, such as Docker Hub, with a username and password for use in CloudBees workflows.
|
Before using this action, add the following step to your workflow:
|
Sign in to a registry and push a container image
Sign in to an OCI registry, then build, tag, and push a container image to it.
- name: Sign in to OCI registry uses: https://github.com/cloudbees-io/configure-oci-credentials@v1 with: registry: ${{ vars.OCI_REGISTRY }} username: ${{ secrets.OCI_USERNAME }} password: ${{ secrets.OCI_PASSWORD }} - name: Build, tag, and push container image to OCI registry uses: https://github.com/cloudbees-io/kaniko@v1 with: destination: ${{ vars.OCI_REGISTRY }}/my-oci-repo:latest
Sign in to a registry and push a Helm chart
Sign in to an OCI registry, then package and push a Helm chart to it.
- name: Sign in to OCI registry uses: https://github.com/cloudbees-io/configure-oci-credentials@v1 with: registry: ${{ vars.OCI_REGISTRY }} username: ${{ secrets.OCI_USERNAME }} password: ${{ secrets.OCI_PASSWORD }} - name: Package and push Helm chart to OCI registry uses: docker://alpine/helm:latest run: | helm package my-oci-repo helm push my-oci-repo-0.1.0.tgz ${{ vars.OCI_REGISTRY }}
| Helm and Kaniko use the same credential store, so you can use the same credentials for both. |
Sign in to multiple OCI registries
Merge credentials into ~/.docker/config.json by chaining multiple sign-in steps to ensure sufficient credentials to build and publish an image.