Documentation for Lifecycle.
Making a post can be done in a few steps.
- Create a new
.mdxfile in thesrc/pagesdirectory. - Add frontmatter to the top of the file including at least
title, anddescription. It will look like so:--- title: "My Post" description: "This is a description of my post." ---
- Write your content in markdown.
- Add images to the
publicdirectory and reference them in your markdown. Images should be placed in a subdirectory ofpublicwith the same name as the.mdxfile.// example src/pages/docs/troubleshooting/<new-page> public/docs/troubleshooting/new-page>
Lifecycle Docs provides a few extra components in addition to components provided by Nextra. View all the currently exported components here.
- Components like Image & Iframe have been added to make the docs look more consistent visually.
The <Image> component is a wrapper around next/image that provides a few extra features to make it easier to look nice in the docs.
import Image from '@lifecycle-docs/components';
<Image src="/path/to/image.png" alt="Alt text" width={16} height={9} ratio={16 / 9} />You can center the image by adding the center prop and some extra JSX.
<div className="grid pt-6">
<div className="place-self-center w-[500px]">
<Image
src="/custom-multi-service-lifecycle-environments/additional-optional-services.png"
alt="Additional Optional Services"
height={906}
width={538}
ratio={538 / 906}
imagePosition="center"
/>
</div>
</div>The <Iframe> component is a wrapper around an iframe that provides a few extra features to make it easier to look nice in the docs.
import { Iframe } from '@lifecycle-docs/components';
<Iframe src="https://example.com" title="Example" />Ensure you're using the correct version of node
# or, n i auto
npm install bun -gInstall the dependencies
bun installRun the development server
bun run devThis site is deployed to GitHub Pages using GitHub Actions. When changes are pushed to the oss branch, a GitHub Action workflow automatically builds the site and deploys it to the gh-pages branch.
The deployment process is handled by a GitHub Actions workflow defined in .github/workflows/deploy.yml. This workflow:
- Runs when changes are pushed to the
ossbranch - Sets up Bun
- Installs dependencies
- Builds the static site
- Deploys the built site to the
gh-pagesbranch
To enable GitHub Pages for this repository:
- Go to the repository on GitHub
- Click on "Settings"
- Scroll down to the "GitHub Pages" section
- Under "Source", select "Deploy from a branch"
- Under "Branch", select "gh-pages" and "/ (root)"
- Click "Save"
The site will be available at https://goodrxoss.github.io/lifecycle-docs/ (or your custom domain if configured).
For GitHub Pages deployment, we use a simplified build process that doesn't require GitHub API access. This avoids the need for setting up GitHub secrets for the deployment workflow.
The deployment process:
- Builds the site using the standard build process
- Creates a
.nojekyllfile to prevent GitHub Pages from processing the site with Jekyll
You can also build and deploy the site manually:
-
Build the site:
bun run deploy
-
The static site will be generated in the
outdirectory with a.nojekyllfile. -
To deploy manually, you can push the
outdirectory to thegh-pagesbranch:# First time setup git checkout --orphan gh-pages git reset --hard git commit --allow-empty -m "Initial gh-pages commit" git push origin gh-pages git checkout oss # For subsequent deployments bun run deploy git checkout gh-pages git rm -rf . cp -r out/* . touch .nojekyll git add . git commit -m "Deploy to GitHub Pages" git push origin gh-pages git checkout oss
However, it's recommended to let the GitHub Actions workflow handle the deployment automatically.