Documentation for Lifecycle.
Making a post can be done in a few steps.
- Create a new
.mdx
file in thesrc/pages
directory. - 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
public
directory and reference them in your markdown. Images should be placed in a subdirectory ofpublic
with the same name as the.mdx
file.// 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 -g
Install the dependencies
bun install
Create a PAT with with the permissions below ("code"
is "Read and Write content"
).
Add it to your .env
file by copying .env.example
and adding your PAT to the SYNC_LIFECYCLE_DOCS
and GITHUB_TOKEN
.
rule | access level |
---|---|
members | read |
metadata | read |
actions | read/write |
contents | read/write |
pull requests | read/write |
workflows | read/write |
*The following permissiones allow you to update content located in scripts
Run the development server
bun run dev
This 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
oss
branch - Sets up Bun
- Installs dependencies
- Builds the static site
- Deploys the built site to the
gh-pages
branch
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
.nojekyll
file 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
out
directory with a.nojekyll
file. -
To deploy manually, you can push the
out
directory to thegh-pages
branch:# 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.