-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: rearrange GHA examples * docs: fix link, expand version usage * docs: fix frontmatter examples to reflect the latest * docs: language tweaks, link fixes, emojis * chore: grammar fix * revert: use `main` branch for docs links instead After thinking about it a little bit more, I think it makes more sense for the user to view the docs on `main`, versus on the latest tag. Our docs sync with every push to `main` and we should probably version them so they're better tied to version tags (i.e. they're only published when we bump versions), but I think this is the more intuitive solution for now.
- Loading branch information
1 parent
0c7e364
commit f05d8f1
Showing
3 changed files
with
44 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,8 +37,8 @@ In order to sync a directory of Markdown files to your guides, you'll need to ad | |
|
||
```markdown | ||
--- | ||
title: CLI + GitHub Action Usage | ||
excerpt: Learn more about `rdme`, ReadMe's official CLI and GitHub Action! | ||
title: Syncing Docs via CLI / GitHub | ||
excerpt: Update your docs automatically with `rdme`, ReadMe's official CLI and GitHub Action! | ||
category: 5f7ce9e3a5504d0414d024c2 | ||
--- | ||
|
||
|
@@ -51,8 +51,8 @@ We automatically derive the page's slug via the file name (e.g. the file name `r | |
|
||
```markdown | ||
--- | ||
title: CLI + GitHub Action Usage | ||
excerpt: Learn more about `rdme`, ReadMe's official CLI and GitHub Action! | ||
title: Syncing Docs via CLI / GitHub | ||
excerpt: Update your docs automatically with `rdme`, ReadMe's official CLI and GitHub Action! | ||
category: 5f7ce9e3a5504d0414d024c2 | ||
slug: an-alternative-page-slug-example | ||
--- | ||
|
@@ -93,43 +93,6 @@ To execute this command via GitHub Actions, the step would look like this: | |
We'll dive into several full GitHub Workflow file examples below! | ||
### Example: Syncing Markdown Docs | ||
Not to get too meta on you, but... the page that you're currently reading is actually being synced from the `rdme` GitHub repository via the `rdme` GitHub Action! Here are a few links to the relevant files: | ||
|
||
- [The Markdown source file for the page you're reading](https://github.com/readmeio/rdme/tree/main/documentation/rdme.md) | ||
- [The full GitHub Action workflow file that we use to sync the file to docs.readme.com](https://github.com/readmeio/rdme/blob/main/.github/workflows/docs.yml) | ||
- And finally... [the workflow run results](https://github.com/readmeio/rdme/actions/workflows/docs.yml)! | ||
|
||
To recreate this magic in your repository, your GitHub Workflow file will look something like this: | ||
|
||
```yml | ||
name: Sync `documentation` directory to ReadMe | ||
|
||
# Run workflow for every push to the `main` branch | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
sync: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout this repo | ||
uses: actions/[email protected] | ||
|
||
# Run GitHub Action to sync docs in `documentation` directory | ||
- name: GitHub Action | ||
# We recommend specifying a fixed version, i.e. @RDME_VERSION | ||
# Docs: https://docs.github.com/actions/using-workflows/workflow-syntax-for-github-actions#example-using-versioned-actions | ||
uses: readmeio/rdme@RDME_VERSION | ||
with: | ||
rdme: docs ./documentation --key=API_KEY --version=2.0 | ||
``` | ||
In the example above, every push to the `main` branch will check out your repository's contents and sync the contents of the `documentation` directory with your ReadMe project. | ||
|
||
### Example: Syncing an OpenAPI Definition | ||
To sync an OpenAPI or Swagger definition, you'll first want to obtain a unique API definition ID from ReadMe so we know which definition you want to update on subsequent re-syncs. You can obtain this API definition ID in one of several ways, but we'll dive into two below: uploading a file directly into the ReadMe dashboard and using the `rdme` CLI locally. | ||
|
@@ -194,6 +157,43 @@ jobs: | |
In the example above, every push to the `main` branch will check out your repository's contents and sync the OpenAPI file located at `./path-to-file.json` with your ReadMe project. | ||
|
||
### Example: Syncing Markdown Docs | ||
|
||
Not to get too meta on you, but... the page that you're currently reading is actually being synced from the `rdme` GitHub repository via the `rdme` GitHub Action! Here are the relevant files on GitHub: | ||
|
||
- [The Markdown source file for the page you're reading](https://github.com/readmeio/rdme/blob/main/documentation/rdme.md) 📜 | ||
- [The GitHub Action workflow file that syncs the Markdown to docs.readme.com](https://github.com/readmeio/rdme/blob/main/.github/workflows/docs.yml) 🔄 | ||
- And finally... [the workflow run results](https://github.com/readmeio/rdme/actions/workflows/docs.yml) ✅ | ||
|
||
To recreate this magic in your repository, your GitHub Workflow file will look something like this: | ||
|
||
```yml | ||
name: Sync `documentation` directory to ReadMe | ||
|
||
# Run workflow for every push to the `main` branch | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
sync: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout this repo | ||
uses: actions/[email protected] | ||
|
||
# Run GitHub Action to sync docs in `documentation` directory | ||
- name: GitHub Action | ||
# We recommend specifying a fixed version, i.e. @RDME_VERSION | ||
# Docs: https://docs.github.com/actions/using-workflows/workflow-syntax-for-github-actions#example-using-versioned-actions | ||
uses: readmeio/rdme@RDME_VERSION | ||
with: | ||
rdme: docs ./documentation --key=API_KEY --version=2.0 | ||
``` | ||
In the example above, every push to the `main` branch will check out your repository's contents and sync the contents of the `documentation` directory with your ReadMe project. | ||
|
||
### Example: Using GitHub Secrets | ||
|
||
> 🚧 Secretly store your ReadMe API Key! | ||
|