If we are not deploying EKS, it's not worth the additional effort to set up Self-Hosted runners on EKS. Instead, we
@@ -32,134 +35,155 @@ hand the setup back to Cloud Posse. Then Cloud Posse can deploy the component an
customer will then need to add the webhook to the GitHub App and ensure the App is installed to all relevant GitHub
repositories.
-Follow the guide with the upstream module,
-[philips-labs/terraform-aws-github-runner](https://github.com/philips-labs/terraform-aws-github-runner#setup-github-app-part-1),
-or follow the steps below.
+Follow the guide with the upstream module, [philips-labs/terraform-aws-github-runner](https://github.com/philips-labs/terraform-aws-github-runner#setup-github-app-part-1), or follow the steps below.
-### Create the GitHub App
+
+
+ ### Create the GitHub App
-:::info Customer Requirement
+ :::info Customer Requirement
-This step requires access to the GitHub Organization. Customers will need to create this GitHub App in Jumpstart
-engagements.
+ This step requires access to the GitHub Organization. Customers will need to create this GitHub App in Jumpstart
+ engagements.
-:::
+ :::
-1. Create a new GitHub App
-1. Choose a name
-1. Choose a website (mandatory, not required for the module).
-1. Disable the webhook for now (we will configure this later or create an alternative webhook).
-1. Add the following permission:
+
+ 1. Create a new GitHub App
+ 1. Choose a name
+ 1. Choose a website (mandatory, not required for the module).
+ 1. Disable the webhook for now (we will configure this later or create an alternative webhook).
+ 1. Add the following permission:
+ ```diff
+ # Required Permissions for Repository Runners:
+ ## Permissions for all runners:
+ ### Repository:
+ + Actions: Read-only (check for queued jobs)
+ + Checks: Read-only (receive events for new builds)
+ + Metadata: Read-only (default/required)
-```diff
-# Required Permissions for Repository Runners:
-## Permissions for all runners:
-### Repository:
-+ Actions: Read-only (check for queued jobs)
-+ Checks: Read-only (receive events for new builds)
-+ Metadata: Read-only (default/required)
+ ## Permissions for repository-level runners only:
+ ### Repository:
+ + Administration: Read & write (to register runner)
-## Permissions for repository-level runners only:
-### Repository:
-+ Administration: Read & write (to register runner)
+ ## Permissions for organization-level runners only:
+ ### Organization
+ + Self-hosted runners: Read & write (to register runner)
+ ```
-## Permissions for organization-level runners only:
-### Organization
-+ Self-hosted runners: Read & write (to register runner)
-```
+ 1. Generate a Private Key
+
-6. Generate a Private Key
+ If you are working with Cloud Posse, upload this Private Key and GitHub App ID to 1Password and inform Cloud Posse.
+ Otherwise, continue with the component deployment in `core-use1-auto`.
+
-If you are working with Cloud Posse, upload this Private Key and GitHub App ID to 1Password and inform Cloud Posse.
-Otherwise, continue with the component deployment in `core-use1-auto`.
+
+ ### Deploy the `philips-labs-github-runner` Component
-### Deploy the `philips-labs-github-runner` Component
+ :::tip
-:::tip
+ This step does _not_ require access to the GitHub Organization. Cloud Posse will run this deployment for Jumpstart
+ engagements.
-This step does _not_ require access to the GitHub Organization. Cloud Posse will run this deployment for Jumpstart
-engagements.
+ :::
-:::
+ Run the `deploy/pl-github-runners` workflow with `atmos` to write the GitHub App information to the `core-use1-auto`
+ SSM account and deploy the component.
-Run the `deploy/pl-github-runners` workflow with `atmos` to write the GitHub App information to the `core-use1-auto`
-SSM account and deploy the component.
+
-
+ This is the same as the following steps:
-This is the same as the following steps:
+
+ 1. Upload the PEM file key to the specified ssm path, `/pl-github-runners/key`, in `core-use1-auto` as a base64
+ encoded string.
+ 2. Upload the GitHub App ID to the specified ssm path, `/pl-github-runners/id`, in `core-use1-auto`.
+ 3. Deploy the `philips-labs-github-runners` component to `core-use1-auto`. Run this with the following:
-1. Upload the PEM file key to the specified ssm path, `/pl-github-runners/key`, in `core-use1-auto` as a base64
- encoded string.
-2. Upload the GitHub App ID to the specified ssm path, `/pl-github-runners/id`, in `core-use1-auto`.
-3. Deploy the `philips-labs-github-runners` component to `core-use1-auto`. Run this with the following:
+ ```console
+ atmos terraform apply philips-labs-github-runners -s core-use1-auto
+ ```
-```console
-atmos terraform apply philips-labs-github-runners -s core-use1-auto
-```
+ Once the component is deployed, save the webhook URL and secret in 1Password. The endpoint can be found with the
+ following:
-Once the component is deployed, save the webhook URL and secret in 1Password. The endpoint can be found with the
-following:
+ ```console
+ atmos terraform output philips-labs-github-runners -s core-use1-auto 'webhook'
+ ```
+
+
-```console
-atmos terraform output philips-labs-github-runners -s core-use1-auto 'webhook'
-```
+
+ ### Add the Webhook to the GitHub App
-### Add the Webhook to the GitHub App
+ :::info Customer Requirement
-:::info Customer Requirement
+ This step requires access to the GitHub Organization. Customers will need to finalize the GitHub App in Jumpstart
+ engagements.
-This step requires access to the GitHub Organization. Customers will need to finalize the GitHub App in Jumpstart
-engagements.
+ :::
-:::
+ Now that the component is deployed and the webhook has been created, add that webhook to the GitHub App. Both the
+ webhook URL and secret should now be stored in 1Password. If not, you can retrieve these values from the output of the
+ `philips-labs-github-runners` component in `core-use1-auto` as described in the previous step.
-Now that the component is deployed and the webhook has been created, add that webhook to the GitHub App. Both the
-webhook URL and secret should now be stored in 1Password. If not, you can retrieve these values from the output of the
-`philips-labs-github-runners` component in `core-use1-auto` as described in the previous step.
+
+ 1. Open the GitHub App created in
+ [Create the GitHub App above](/layers/github-actions/philips-labs-github-runners/#create-the-github-app)
+ 1. Enable the webhook.
+ 1. Provide the webhook url, should be part of the output of terraform.
+ 1. Provide the webhook secret (`terraform output -raw `).
+ 1. In the _"Permissions & Events"_ section and then _"Subscribe to Events"_ subsection, check _"Workflow Job"_.
-1. Open the GitHub App created in
- [Create the GitHub App above](/layers/github-actions/philips-labs-github-runners/#create-the-github-app)
-1. Enable the webhook.
-1. Provide the webhook url, should be part of the output of terraform.
-1. Provide the webhook secret (`terraform output -raw `).
-1. In the _"Permissions & Events"_ section and then _"Subscribe to Events"_ subsection, check _"Workflow Job"_.
+ 1. Ensure the webhook for the GitHub app is enabled and pointing to the output of the module.
+ - The endpoint can be found from `atmos terraform output philips-labs-github-runners -s core-use1-auto 'webhook'`
+
+
-1. Ensure the webhook for the GitHub app is enabled and pointing to the output of the module.
- - The endpoint can be found from `atmos terraform output philips-labs-github-runners -s core-use1-auto 'webhook'`
+
+ ## Vendor Components
-## Vendor
+ Vendor in the necessary components with the following workflow:
-Vendor in the necessary components with the following workflow:
+
+
-
+
+ ## Deploy the Philips Labs Runners
-## Deploy
+ :::info
+
+ You can run all workflows at once in the right order with
-:::info
+
-You can run all workflows at once in the right order with
+ :::
+
-
+
+ ### GitHub OIDC Provider
-:::
+ First deploy the GitHub OIDC provider to all accounts where we want to grant GitHub access. The typical list of accounts
+ is included with the `deploy/github-oidc-provider` workflow; run the following with `SuperAdmin`:
-### GitHub OIDC Provider
+
+
-First deploy the GitHub OIDC provider to all accounts where we want to grant GitHub access. The typical list of accounts
-is included with the `deploy/github-oidc-provider` workflow; run the following with `SuperAdmin`:
+
+ ### GitHub Runners
-
+ To deploy the self-hosted runners themselves, first verify [the GitHub App requirement](#Requirements) is complete
+ including both SSM parameters. Next we will deploy the token rotator and then the runners themselves.
-### GitHub Runners
+
-To deploy the self-hosted runners themselves, first verify [the GitHub App requirement](#Requirements) is complete
-including both SSM parameters. Next we will deploy the token rotator and then the runners themselves.
+ If all goes well, you should now see self-hosted runners registered to your infrastructure repository in GitHub. If not,
+ read through the attached [FAQs](#FAQ).
+
-
-If all goes well, you should now see self-hosted runners registered to your infrastructure repository in GitHub. If not,
-read through the attached [FAQs](#FAQ).
+
## Usage
diff --git a/src/components/Step/index.js b/src/components/Step/index.js
index b9abbbcb3..d9648056b 100644
--- a/src/components/Step/index.js
+++ b/src/components/Step/index.js
@@ -1,30 +1,16 @@
// src/components/Step.js
-import React, { useEffect, useState, createContext, useContext } from 'react';
+import React, { useContext } from 'react';
+import { StepContext } from '@site/src/components/Steps';
import './index.css';
-let stepCounter = 0;
-
-export const StepContext = createContext(0);
-
-export const resetStepCounter = () => {
- stepCounter = 0;
-};
-
const Step = ({ title, children }) => {
- const [stepNumber, setStepNumber] = useState(stepCounter);
-
- useEffect(() => {
- stepCounter += 1;
- setStepNumber(stepCounter);
- }, []);
+ const stepNumber = useContext(StepContext); // Consume the step number from context
return (
-
-
- {title &&
{`Step ${stepNumber}: ${title}`}
}
-
{children}
-
-
+
+ {title &&
{`Step ${stepNumber}: ${title}`}
}
+
{children}
+
);
};
diff --git a/src/components/StepNumber/index.js b/src/components/StepNumber/index.js
index 719b94933..d9b1e49e4 100644
--- a/src/components/StepNumber/index.js
+++ b/src/components/StepNumber/index.js
@@ -1,11 +1,15 @@
+// src/components/StepNumber.js
import React, { useContext } from 'react';
-import { StepContext } from '@site/src/components/Step';
+import { StepContext } from '@site/src/components/Steps';
import clsx from 'clsx';
import styles from './index.module.css';
const StepNumber = () => {
- const stepNumber = useContext(StepContext);
- return ({`${stepNumber}`});
+ const stepNumber = useContext(StepContext); // Get the step number from the context
+
+ return (
+ {`${stepNumber}`}
+ );
};
export default StepNumber;
diff --git a/src/components/Steps/index.js b/src/components/Steps/index.js
index 75d576dc9..04660f0e5 100644
--- a/src/components/Steps/index.js
+++ b/src/components/Steps/index.js
@@ -1,28 +1,24 @@
// src/components/Steps.js
-import React, { useEffect, useState, createContext, useContext } from 'react';
+import React, { useState } from 'react';
import clsx from 'clsx';
import styles from './index.module.css';
-let stepCounter = 0;
+export const StepContext = React.createContext();
-export const StepContext = createContext(0);
-
-export const resetStepCounter = () => {
- stepCounter = 0;
-};
-
-const Steps = ({ title, children }) => {
- const [stepNumber, setStepNumber] = useState(stepCounter);
-
- useEffect(() => {
- stepCounter += 1;
- setStepNumber(stepCounter);
- }, []);
+const Steps = ({ children }) => {
+ const [stepCounter, setStepCounter] = useState(0);
return (
-
- {children}
-
+
+ {React.Children.map(children, (child, index) => {
+ // Provide a unique step number for each child
+ return (
+
+ {child}
+
+ );
+ })}
+
);
};
diff --git a/src/theme/DocItem/Layout/index.js b/src/theme/DocItem/Layout/index.js
index a3f6452f3..a49944037 100644
--- a/src/theme/DocItem/Layout/index.js
+++ b/src/theme/DocItem/Layout/index.js
@@ -1,10 +1,9 @@
import React, { useEffect } from 'react';
import Layout from '@theme-original/DocItem/Layout';
-import { resetStepCounter } from '@site/src/components/Step';
export default function LayoutWrapper(props) {
useEffect(() => {
- resetStepCounter(); // Reset the counter whenever the layout is rendered
+
}, []);
return (