{"id":20189432,"url":"https://github.com/redhat-actions/oc-new-app","last_synced_at":"2025-04-10T07:52:20.535Z","repository":{"id":42473502,"uuid":"343408425","full_name":"redhat-actions/oc-new-app","owner":"redhat-actions","description":"Github Action to deploy and expose an application on Openshift","archived":false,"fork":false,"pushed_at":"2024-03-16T19:13:30.000Z","size":248,"stargazers_count":7,"open_issues_count":3,"forks_count":10,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-24T08:07:09.820Z","etag":null,"topics":["cloud","deployment","github-action","oc","openshift","redhat"],"latest_commit_sha":null,"homepage":"https://github.com/marketplace/actions/oc-new-app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/redhat-actions.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-01T12:28:09.000Z","updated_at":"2023-10-04T05:57:02.000Z","dependencies_parsed_at":"2024-06-18T21:23:14.159Z","dependency_job_id":"962132d4-3493-4f90-b129-16333781653e","html_url":"https://github.com/redhat-actions/oc-new-app","commit_stats":{"total_commits":42,"total_committers":3,"mean_commits":14.0,"dds":0.2142857142857143,"last_synced_commit":"5630e9dbddf24820195fd8f0a8056e3361e1159c"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-actions%2Foc-new-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-actions%2Foc-new-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-actions%2Foc-new-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-actions%2Foc-new-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/redhat-actions","download_url":"https://codeload.github.com/redhat-actions/oc-new-app/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247871167,"owners_count":21009997,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloud","deployment","github-action","oc","openshift","redhat"],"created_at":"2024-11-14T03:37:06.379Z","updated_at":"2025-04-10T07:52:20.487Z","avatar_url":"https://github.com/redhat-actions.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# oc-new-app\n[![CI checks](https://github.com/redhat-actions/oc-new-app/actions/workflows/ci-checks.yml/badge.svg)](https://github.com/redhat-actions/oc-new-app/actions/workflows/ci-checks.yml)\n[![OpenShift Pet Clinic Workflow](https://github.com/redhat-actions/oc-new-app/actions/workflows/example.yml/badge.svg)](https://github.com/redhat-actions/oc-new-app/actions/workflows/example.yml)\n[![Link checker](https://github.com/redhat-actions/oc-new-app/workflows/Link%20checker/badge.svg)](https://github.com/redhat-actions/oc-new-app/actions?query=workflow%3A%22Link+checker%22)\n\n[![tag badge](https://img.shields.io/github/v/tag/redhat-actions/oc-new-app)](https://github.com/redhat-actions/buildah-build/tags)\n[![license badge](https://img.shields.io/github/license/redhat-actions/oc-new-app)](./LICENSE)\n[![size badge](https://img.shields.io/github/size/redhat-actions/oc-new-app/dist/index.js)](./dist)\n\n**oc-new-app** is a Github Action for deploying and exposing a single-container application on OpenShift.\n\nThis action wraps [`oc new-app`](https://docs.openshift.com/container-platform/4.6/applications/application_life_cycle_management/creating-applications-using-cli.html) to provide a simple interface for deploying an application.\n\nIt creates a Deployment which runs the application Pod, and then exposes that pod to the internet through a Service and a Route.\n\n\u003ca id=\"prerequisites\"\u003e\u003c/a\u003e\n\n## Prerequisites\n\n- An OpenShift Cluster is required. To try an OpenShift cluster, visit [openshift.com/try](https://openshift.com/try) or sign up for our [Developer Sandbox](https://developers.redhat.com/developer-sandbox).\n- `oc` must be installed on the GitHub Action runner you specify.\n    - Presently the [Ubuntu Environments](https://github.com/actions/virtual-environments#available-environments) come with `oc` 4.7.0 installed.\n    - If you want a different version of `oc`, or if you are using the Mac or Windows environments, use the [**openshift-tools-installer**](https://github.com/redhat-actions/openshift-tools-installer) to install `oc` before running this action.\n- You must log in to your OpenShift cluster, preferably by using [**oc-login**](https://github.com/redhat-actions/oc-login).\n\n\u003ca id=\"action-inputs\"\u003e\u003c/a\u003e\n\n## Action inputs\n\n| Input | Description | Default |\n| ----- | ----------- | ------- |\n| app_name | Name to use for the generated application artifacts. | **Must be provided** |\n| build_env | Environment variable key-value pairs to pass to the build container at the run time. Use the form `env_name=env_value`, and separate arguments with newlines. | None\n| create_pull_secret_from | Registry credentials file to use to create a pull secret. Set this to `docker` or `podman` depending on which tool you used to log in. See [using-private-images](#using-private-images). | None\n| image | The fully qualified name of the application image. It can be a container image or an image stream. For more information, refer to [the OpenShift documentation](https://docs.openshift.com/container-platform/4.7/applications/application_life_cycle_management/creating-applications-using-cli.html#applications-create-using-cli-image_creating-applications-using-cli). | **Must be provided** |\n| image_pull_secret_name | In the case of private images, provide the image pull secret name if you have already created that. Otherwise, see [using-private-images](#using-private-images). | None\n| namespace | OpenShift project/Kubernetes namespace to target. | Current context |\n| port | A port to expose from the application container through a Service. If exactly one port is exposed in the container metadata, then this input can be omitted. For more details [see](https://docs.openshift.com/container-platform/4.7/applications/application_life_cycle_management/creating-applications-using-cli.html#applications-create-using-cli-modify_creating-applications-using-cli). | None |\n| registry_hostname | The Hostname/domain of the container image registry such as quay.io, or docker.io that a private container image will be pulled from. The pull secret is used to access this registry. See [using-private-images](#using-private-images). | None\n| registry_username | Registry username to use for the pull secret. | None\n| registry_password | Password, encrypted password, or access token of the provided registry to use for the pull secret. | None\n\n\u003ca id=\"action-outputs\"\u003e\u003c/a\u003e\n\n## Action outputs\n\n| Output | Description |\n| ------ | ----------- |\n| route | URL to the application route. |\n| selector | Label selector of the created resources. |\n\n\u003ca id=\"example\"\u003e\u003c/a\u003e\n\n## Example\n\nThe example below shows how the **oc-new-app** action can be used to deploy and expose a\napplication on OpenShift.\n\n```yaml\nsteps:\n- name: Create and expose app\n  uses: redhat-actions/oc-new-app@v1\n  with:\n    app_name: petclinic\n    image: quay.io/redhat-github-actions/petclinic:v1\n    namespace: github-actions-bot-dev\n```\nTo build and push the container image to a registry such as [quay.io](https://quay.io), use the [**buildah-build**](https://github.com/redhat-actions/buildah-build)\nand [**push-to-registry**](https://github.com/redhat-actions/push-to-registry) actions.\n\nFor a complete example see the [example workflow](.github/workflows/example.yml).\n\n\u003ca id=\"using-private-images\"\u003e\u003c/a\u003e\n\n## Using private images\n\nIf your deployment requires a private image, this action will create an [image pull secret](https://docs.openshift.com/container-platform/4.7/openshift_images/managing_images/using-image-pull-secrets.html#images-allow-pods-to-reference-images-from-secure-registries_using-image-pull-secrets) which will allow\nto reference image from secured registries. Use one of the methods given below to setup image pull secret:\n\n- If you have already created the secret, use the `image_pull_secret_name` input to specify the name of the created pull secret. Make sure that secret is created in the namespace in which you want to create the deployment.\n\n- If you have already logged in to a container image registry, use the `create_pull_secret_from` input to specify the tool you used to log in. This input tells the action where to find the credentials file to use to setup the pull secret.\nSet `create_pull_secret_from` to `docker` or `podman` depending on which of those two tools you used to log in. This will create a pull secret using the credentials file.\n\n- If you haven't already logged in to the container image registry, set inputs `registry_hostname`, `registry_username` and `registry_password` with your registry details and this action will create the pull secret.\n\nFinally, created pull secret will be linked to the `default` service account.\n\nAny image pull secrets created will be provided with the label `app.kubernetes.io/managed-by=oc-new-app-action`, and once this action finish it's execution created secret will be cleaned up from the cluster.\n\n## Troubleshooting\n\nNote that [quay.io](https://quay.io) repositories are private by default.\n\nThis means that if you push an image for the first time, you will have to authenticate before pulling it, or go to the repository's settings and change its visibility.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredhat-actions%2Foc-new-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredhat-actions%2Foc-new-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredhat-actions%2Foc-new-app/lists"}