GitHub Action
Get or create an Oracle Cloud Infrastructure Registry (OCIR) repository
Use this GitHub Action to return the OCID and full URI for the specified Oracle Cloud Infrastructure Registry (OCIR) repository. If the repository does not exist, it will be created automatically.
The following OCI CLI environment variables must be defined for at least
the run-oci-cli-command
task:
OCI_CLI_USER
OCI_CLI_TENANCY
OCI_CLI_FINGERPRINT
OCI_CLI_KEY_CONTENT
OCI_CLI_REGION
We recommend using GitHub Secrets to store these values. If you have more than one tas that requires these values, consider defining your environment variables at the job or workflow level.
name
: the name of the repositorycompartment
: the OCID of the compartment in which to search for or create the repository
repo_ocid
: The OCID of the repositoryrepo_path
: The full URI to the repository. This can be passed directly to Docker or Podman.
This sample workflow requires the OCID of the compartment to be saved as a
GitHub Secret named OCI_COMPARTMENT
.
jobs:
my-instances:
runs-on: ubuntu-latest
name: Get the exact URL to the private-repo in OCIR
env:
OCI_CLI_USER: ${{ secrets.OCI_CLI_USER }}
OCI_CLI_TENANCY: ${{ secrets.OCI_CLI_TENANCY }}
OCI_CLI_FINGERPRINT: ${{ secrets.OCI_CLI_FINGERPRINT }}
OCI_CLI_KEY_CONTENT: ${{ secrets.OCI_CLI_KEY_CONTENT }}
OCI_CLI_REGION: ${{ secrets.OCI_CLI_REGION }}
steps:
- name: Get private OCIR repository
uses: oracle-actions/[email protected]
id: get-ocir-repository-path
with:
compartment: ${{ secrets.OCI_COMPARTMENT }}
name: 'private-repo'
- name: Build and push a container image
run: |
docker build -t "${{ steps.get-ocir-repository-path.outputs.repo_path }}:latest" .
docker push "${{ steps.get-ocir-repository-path.outputs.repo_path }}:latest"
See action.yml
for more details.
We welcome contributions from the community. Before submitting a pull request, please review our contribution guide.
Please consult the security guide for our responsible security vulnerability disclosure process.
Copyright (c) 2021 Oracle and/or its affiliates.
Released under the Universal Permissive License v1.0 as shown at https://oss.oracle.com/licenses/upl/.