Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: v8 docs #637

Merged
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
50218f3
docs: updated setup/auth instructions
kanadgupta Oct 11, 2022
7fb8a95
chore: drop v8 callout
kanadgupta Oct 12, 2022
dbf2b2e
docs: first pass at content reorg
kanadgupta Oct 12, 2022
ec2cba3
chore: link fixes, more cleanup and language alignment
kanadgupta Oct 12, 2022
05d2be0
docs: update cover image
kanadgupta Oct 12, 2022
baccdf5
Merge branch 'main' into kanad/rm-5536-update-docs-in-github-repo-and…
kanadgupta Oct 13, 2022
ca80b32
chore: remove heading, add alt text
kanadgupta Oct 13, 2022
bc5d97e
chore: fix a few duplicated headers
kanadgupta Oct 13, 2022
92a0c09
docs: rework headers
kanadgupta Oct 13, 2022
f76b797
docs(openapi): update heading hierarchy, content updates
kanadgupta Oct 13, 2022
4b68b5b
Merge branch 'main' into kanad/rm-5536-update-docs-in-github-repo-and…
kanadgupta Oct 13, 2022
0bb1cc4
Merge branch 'main' into kanad/rm-5536-update-docs-in-github-repo-and…
kanadgupta Oct 14, 2022
3778676
chore: c'mon dude
kanadgupta Oct 14, 2022
487431a
docs(openapi): content reorg, better intro
kanadgupta Oct 14, 2022
c17e446
docs(GHA): cleanup
kanadgupta Oct 14, 2022
b7de5d5
Merge branch 'main' into kanad/rm-5536-update-docs-in-github-repo-and…
kanadgupta Oct 17, 2022
fc7eb5d
chore: update comments
kanadgupta Oct 18, 2022
2df9a2b
docs: add CircleCI + Travis examples
kanadgupta Oct 18, 2022
6c09206
docs: add setup language on node.js
kanadgupta Oct 18, 2022
38c0695
docs: periods
kanadgupta Oct 18, 2022
8cff5a4
docs: sentence flow fix
kanadgupta Oct 18, 2022
462c7b0
docs: add TOC (😭)
kanadgupta Oct 18, 2022
99d505b
chore: removing emojis in headings
kanadgupta Oct 18, 2022
933a3a9
docs: better dependabot callouts
kanadgupta Oct 19, 2022
b46ff0c
chore: move callout
kanadgupta Oct 19, 2022
c7906fb
docs: reworked intro
kanadgupta Oct 19, 2022
95e2db0
Merge branch 'main' into kanad/rm-5536-update-docs-in-github-repo-and…
kanadgupta Oct 19, 2022
910553a
docs: rearranging sections/headers, link fixes
kanadgupta Oct 19, 2022
ef87ea6
chore: rearrange event examples
kanadgupta Oct 19, 2022
918f24e
chore: small language rework
kanadgupta Oct 19, 2022
f3c622a
docs: try emojis in headers, do these work?
kanadgupta Oct 19, 2022
94d294a
fix: remove encoded emojis from TOC
kanadgupta Oct 19, 2022
20f87d1
chore: add comment about how to generate TOC
kanadgupta Oct 19, 2022
05f9cf7
Merge branch 'main' into kanad/rm-5536-update-docs-in-github-repo-and…
kanadgupta Oct 27, 2022
16f7fd5
chore: "guides", docs example usage
kanadgupta Oct 27, 2022
49de395
chore: swap emoji
kanadgupta Oct 27, 2022
ec8a019
Merge branch 'main' into kanad/rm-5536-update-docs-in-github-repo-and…
kanadgupta Oct 27, 2022
d884bae
chore: fix TOC
kanadgupta Oct 27, 2022
ee03540
Merge branch 'main' into kanad/rm-5536-update-docs-in-github-repo-and…
kanadgupta Oct 27, 2022
ea61755
chore: use our reducer people
kanadgupta Oct 28, 2022
3ba7bcb
fix: add emoji instead of period
kanadgupta Oct 28, 2022
36654f2
chore: update package description
kanadgupta Oct 28, 2022
b5505ea
Merge branch 'main' into kanad/rm-5536-update-docs-in-github-repo-and…
kanadgupta Oct 31, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
if: github.event_name == 'push' && github.event.ref == 'refs/heads/main'
# We use the `main` branch as ref for GitHub Action
# This is NOT recommended, as it can break your workflows without notice!
# We recommend specifying a fixed version, i.e. @7.0
# We recommend specifying a fixed version, i.e. @8.0.0
# Docs: https://docs.github.com/actions/using-workflows/workflow-syntax-for-github-actions#example-using-versioned-actions
uses: readmeio/rdme@main
with:
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Once you've installed `act`, it'll ask you what Docker image size you'd like. Th
-P ubuntu-18.04=ghcr.io/catthehacker/ubuntu:act-18.04
```

Our GitHub Actions guidance states that Action workflows should have a [`runs-on` value](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idruns-on) of `ubuntu-latest`. These runners are updated frequently — you can find links to the the latest versions by navigating [here](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#preinstalled-software) and selecting the latest Ubuntu link. Because of this, you'll want to make sure your `ghcr.io/catthehacker/ubuntu` image stays up-to-date by doing a periodic pull:
kanadgupta marked this conversation as resolved.
Show resolved Hide resolved
Our GitHub Actions guidance states that Action workflows should have a [`runs-on` value](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idruns-on) of `ubuntu-latest`. These runners are updated frequently — you can find links to the latest versions by navigating [here](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#preinstalled-software) and selecting the latest Ubuntu link. Because of this, you'll want to make sure your `ghcr.io/catthehacker/ubuntu` image stays up-to-date by doing a periodic pull:

```sh
docker pull ghcr.io/catthehacker/ubuntu:act-latest
Expand Down
147 changes: 75 additions & 72 deletions README.md

Large diffs are not rendered by default.

64 changes: 64 additions & 0 deletions documentation/github-actions-docs-example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
title: 'GitHub Action Example: Syncing Markdown'
category: 5f7ce9e3a5504d0414d024c2
---

<!--

Hello curious raw Markdown reader! 👋
This Markdown page is syncing to ReadMe via the `rdme` GitHub Action 🦉
Check out the full example below,
and peep the resulting page in our docs: https://docs.readme.com/docs/github-actions-docs-example

We also do some fancy little find-and-replace action to swap out every instance
of `RDME_VERSION` below with the latest version of rdme.
Check out `.github/workflows/docs.yml` for more info on this!

-->

Do you have Markdown files stored on GitHub? With [the `rdme` GitHub Action](https://docs.readme.com/docs/rdme), you can sync them to ReadMe every time they're updated in GitHub. Let's go over how to set this up!

## "Automagical" Workflow File Generation 🪄

To set up a GitHub Actions workflow for syncing a directory of Markdown docs, the fastest and easiest way to do so is by running the following command on your local machine:

```sh
rdme docs [path-to-directory-of-markdown] --github
```

This will scan the directory for Markdown files, sync them to ReadMe, and then create your GitHub Actions workflow file. Once that's done, create your [repository secret](url), push your workflow file to GitHub, and get syncing! 🎊

## Constructing a GitHub Actions Workflow File By Hand 🔨

> 🚧 Wait — there’s an easier way to do this!
>
> The information below is useful if you have experience using GitHub Actions, but for most folks, we recommend using the steps [detailed above](#automagical-workflow-file-generation-🪄). The `rdme` CLI will ask you a few questions before automatically creating the GitHub Actions workflow file for you, complete with every parameter you need to get syncing.
kanadgupta marked this conversation as resolved.
Show resolved Hide resolved

In order to construct the file by hand, you'll first want to grab a project version to ensure that your docs sync to the right place in your developer hub. That version will be passed via the `--version` flag. See below for a full example:

```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/checkout@v3

# Run GitHub Action to sync docs in `documentation` directory
- name: GitHub Action
# We recommend specifying a fixed version, i.e. @RDME_VERSION
kanadgupta marked this conversation as resolved.
Show resolved Hide resolved
# 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=${{ secrets.README_API_KEY }} --version=2.0
```

In the example above, every push to the `main` branch will sync the Markdown contents of the `documentation` directory to version 2.0 of your ReadMe project.
111 changes: 111 additions & 0 deletions documentation/github-actions-openapi-example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
---
title: 'GitHub Action Example: Syncing OpenAPI'
category: 5f7ce9e3a5504d0414d024c2
---

<!--

Hello curious raw Markdown reader! 👋
This Markdown page is syncing to ReadMe via the `rdme` GitHub Action 🦉
Peep the resulting page in our docs: https://docs.readme.com/docs/github-actions-openapi-example

We also do some fancy little find-and-replace action to swap out every instance
of `RDME_VERSION` below with the latest version of rdme.
Check out `.github/workflows/docs.yml` for more info on this!

-->

Is your OpenAPI definition stored on GitHub? With [the `rdme` GitHub Action](https://docs.readme.com/docs/rdme), you can sync it to ReadMe every time it's updated in GitHub. Let's go over how to set this up!

## "Automagical" Workflow File Generation 🪄

To set up a GitHub Actions workflow for syncing an OpenAPI or Swagger definition, the fastest and easiest way to do so is by running the following command on your local machine:

```sh
rdme openapi --github
```

This will locate your OpenAPI definition, sync it to ReadMe, and then create your GitHub Actions workflow file. Once that's done, create your [repository secret](url), push your workflow file to GitHub, and get syncing! 🎊

## Constructing a GitHub Actions Workflow File By Hand 🔨

> 🚧 Wait — there’s an easier way to do this!
>
> The information below is useful if you have experience using GitHub Actions, but for most folks, we recommend using the steps [detailed above](#automagical-workflow-file-generation-🪄). The `rdme` CLI will ask you a few questions before automatically creating the GitHub Actions workflow file for you, complete with every parameter you need to get syncing.

In order to construct the file by hand, 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.

<details>
<summary>Uploading a file</summary>

Follow [these instructions](https://docs.readme.com/docs/openapi#file-upload) on uploading a new OpenAPI file in the dashboard. Once the file is uploaded, you'll see the following in the API Reference settings of your dashboard (the red outline is where you'll find your API definition ID):

![](https://files.readme.io/d57b7c8-Screen_Shot_2022-02-23_at_11.54.21_AM.png)

</details>
<details>
<summary>Using the <code>rdme</code> CLI</summary>

Alternatively, you can obtain the API definition ID by running the following `rdme` CLI command on your local machine:

```sh
rdme openapi [path-to-file.json]
```

Once you follow the prompts and upload your OpenAPI definition, you'll receive a confirmation message that looks something like this:

```
You've successfully updated an OpenAPI file on your ReadMe project!

http://dash.readme.com/project/{your_project}/v1.0/refs/pet

To update your OpenAPI definition, run the following:

rdme openapi [path-to-file.json] --key=<key> --id=API_DEFINITION_ID
```

</details>

We have a walkthrough video available which goes over the whole end-to-end process of obtaining the API definition ID and constructing the GitHub Actions workflow file:

<!--
This is a custom HTML block that we use in ReadMe.
We'll need this to render an iframe of the Loom video demo.
Using our embedly-powered embed block renders an iframe that's way too tall, hence we're using HTML.
You can see the video here: https://www.loom.com/share/e32c20a9dc2f4eeeab42d0c18ba24478
-->

[block:html]
{
"html": "<div style=\"position: relative; padding-bottom: 62.5%; height: 0;\"><iframe src=\"https://www.loom.com/embed/e32c20a9dc2f4eeeab42d0c18ba24478\" frameborder=\"0\" webkitallowfullscreen mozallowfullscreen allowfullscreen style=\"position: absolute; top: 0; left: 0; width: 100%; height: 100%;\"></iframe></div>"
}
[/block]

Once you've obtained your API definition ID (let's call it `API_DEFINITION_ID`), your full GitHub Workflow file will look something like this:

```yml
name: Sync OpenAPI definition 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/checkout@v3

# Run GitHub Action to sync OpenAPI file at [path-to-file.json]
- 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: openapi [path-to-file.json] --key=${{ secrets.README_API_KEY }} --id=API_DEFINITION_ID
```

In the example above, every push to the `main` branch will sync the OpenAPI file located at `./path-to-file.json` to the API specification `API_DEFINITION_ID` in your ReadMe project.
2 changes: 1 addition & 1 deletion documentation/legacy-github-action.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ There are a few things to note:

1. This workflow will infer the `api-version` based on the `API_DEFINITION_ID` parameter that you pass in, so the API version parameter is no longer needed here.
2. `@RDME_VERSION` is the latest version of `rdme`. To ensure you're getting the latest features and security updates, we strongly recommend setting up [Dependabot](https://docs.github.com/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/keeping-your-actions-up-to-date-with-dependabot) to keep this package up-to-date.
3. If you used secrets to encrypt the `readme-oas-key` value, you'll have to split this value out into two separate secrets—one for the API key and one for the API definition ID. You can see an example of this [here](https://docs.readme.com/docs/rdme#example-using-github-secrets).
3. If you used secrets to encrypt the `readme-oas-key` value, you'll have to split this value out into two separate secrets—one for the API key and one for the API definition ID. You can see an example of this [here](https://docs.readme.com/docs/github-actions-openapi-example).

<details>

Expand Down
Loading