Minor composability etc docs changes
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
@@ -11,15 +11,15 @@ TBD
|
||||
### Generic Requirements
|
||||
|
||||
1. Provide OAuth credentials:
|
||||
1. [Create an OAuth App](https://developer.github.com/apps/building-oauth-apps/creating-an-oauth-app/) with callback URL set to `http://localhost:7000/api/auth/github`.
|
||||
2. Take Client ID and Client Secret from the newly created app's settings page and put them into `AUTH_GITHUB_CLIENT_ID` and `AUTH_GITHUB_CLIENT_SECRET` env variables.
|
||||
1. [Create an OAuth App](https://developer.github.com/apps/building-oauth-apps/creating-an-oauth-app/) with the callback URL set to `http://localhost:7000/api/auth/github`.
|
||||
2. Take the Client ID and Client Secret from the newly created app's settings page and put them into `AUTH_GITHUB_CLIENT_ID` and `AUTH_GITHUB_CLIENT_SECRET` environment variables.
|
||||
2. Annotate your component with a correct GitHub Actions repository and owner:
|
||||
|
||||
The annotation key is `github.com/project-slug`.
|
||||
|
||||
Example:
|
||||
|
||||
```
|
||||
```yaml
|
||||
apiVersion: backstage.io/v1alpha1
|
||||
kind: Component
|
||||
metadata:
|
||||
@@ -38,6 +38,7 @@ TBD
|
||||
1. Install the plugin dependency in your Backstage app package:
|
||||
|
||||
```bash
|
||||
# From your Backstage root directory
|
||||
cd packages/app
|
||||
yarn add @backstage/plugin-github-actions
|
||||
```
|
||||
@@ -45,22 +46,24 @@ yarn add @backstage/plugin-github-actions
|
||||
2. Add to the app `EntityPage` component:
|
||||
|
||||
```tsx
|
||||
// packages/app/src/components/catalog/EntityPage.tsx
|
||||
import { EntityGithubActionsContent } from '@backstage/plugin-github-actions';
|
||||
// In packages/app/src/components/catalog/EntityPage.tsx
|
||||
import {
|
||||
EntityGithubActionsContent,
|
||||
isGithubActionsAvailable,
|
||||
} from '@backstage/plugin-github-actions';
|
||||
|
||||
// ...
|
||||
// You can add the tab to any number of pages, the service page is shown as an
|
||||
// example here
|
||||
const serviceEntityPage = (
|
||||
<EntityPageLayout>
|
||||
...
|
||||
<EntityLayout>
|
||||
{/* other tabs... */}
|
||||
<EntityLayout.Route path="/github-actions" title="GitHub Actions">
|
||||
<EntityGithubActionsContent />
|
||||
</EntityLayout.Route>
|
||||
...
|
||||
</EntityPageLayout>
|
||||
);
|
||||
```
|
||||
|
||||
2. Run the app with `yarn start` and the backend with `yarn --cwd packages/backend start`, navigate to `/github-actions/`.
|
||||
3. Run the app with `yarn start` and the backend with `yarn start-backend`.
|
||||
Then navigate to `/github-actions/` under any entity.
|
||||
|
||||
## Features
|
||||
|
||||
|
||||
Reference in New Issue
Block a user