-
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.
docs: add GitHub Actions guidance (#439)
* docs: add GitHub Actions guidance * Update README.md Co-authored-by: Jon Ursenbach <[email protected]> * chore: PR feedback Co-Authored-By: Ryan Park <[email protected]> * chore: more docs cleanup * chore: cleanup rearrange some links, remove language from GitHub docs URLs * ci: add workflow for syncing docs to ReadMe! * chore: temporarily run workflow on every push We're going to revert this, but just want to confirm that our changes work! Co-Authored-By: Ellie Rossuck <[email protected]> * docs: add comment * docs: clarify installation slightly further * docs: update package description * docs: first pass at new docs also making some language tweaks in the main README.md file so messaging and usage is aligned * fix: excerpt, not description * fix: consistent endpoint doc formatting * docs: add snippet on markdown file formatting * docs: one more update of this description * docs: consistent example footer * chore: remove TODO Co-Authored-By: Jon Ursenbach <[email protected]> * ci: dynamically update docs on readme let's hope this works! * fix: glob * docs: more cleanup * chore: replace one more placeholder * docs: fix comment * docs: rearrange status badges * Update documentation/rdme.md Co-authored-by: Dom Harrington <[email protected]> * fix: adjust OAS v3.1 link #439 (comment) * chore: make github docs links less english-centric * docs: update title/description per feedback from Spang * chore: reduce number of unnecessary links * docs: troubleshooting docs * chore: shorten title juuuust a lil bit * feat: add node.js version find/replace * docs: first pass at CI environments stuff Let's hope this works... * chore: rename steps * chore: add comment, try reformatting * chore: fix code block formatting well... this is annoying as hell * ci(docs): restore on step so it only runs on `main` * Update src/lib/getNodeVersion.js Co-authored-by: Jon Ursenbach <[email protected]> Co-authored-by: Jon Ursenbach <[email protected]> Co-authored-by: Ryan Park <[email protected]> Co-authored-by: Ellie Rossuck <[email protected]> Co-authored-by: Jon Ursenbach <[email protected]> Co-authored-by: Dom Harrington <[email protected]>
- Loading branch information
1 parent
e1745bc
commit 3803172
Showing
7 changed files
with
409 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
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] | ||
|
||
# Let's dynamically update our docs with the latest version of rdme! | ||
# Note that these next two steps are not required | ||
# in order to sync your docs to ReadMe. | ||
|
||
# First, we run a script that sets a few outputs: | ||
# our package version and our Node.js version. | ||
- name: Retrieve `rdme` version from package.json | ||
id: rdme-version | ||
run: ./bin/set-version-output | ||
|
||
# Next, we use this output to do a few find/replaces! | ||
- name: Find and replace Node.js version placeholders | ||
uses: jacobtomlinson/gha-find-replace@v2 | ||
with: | ||
find: 'NODE_VERSION' | ||
replace: ${{ steps.rdme-version.outputs.NODE_VERSION }} | ||
regex: false | ||
include: documentation/* | ||
|
||
- name: Find and replace `rdme` version placeholders | ||
uses: jacobtomlinson/gha-find-replace@v2 | ||
with: | ||
find: 'RDME_VERSION' | ||
replace: ${{ steps.rdme-version.outputs.RDME_VERSION }} | ||
regex: false | ||
include: documentation/* | ||
|
||
# And finally, with our updated documentation, | ||
# we run the `rdme` GitHub Action to sync the Markdown file | ||
# in the `documentation` directory. | ||
# Here's the page we're syncing: https://docs.readme.com/docs/rdme | ||
- name: GitHub Action | ||
# 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 | ||
# Docs: https://docs.github.com/actions/using-workflows/workflow-syntax-for-github-actions#example-using-versioned-actions | ||
uses: readmeio/rdme@main | ||
with: | ||
rdme: docs ./documentation --key=${{ secrets.README_PROD_PROJECT_API_KEY }} --version=2.0 |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const getNodeVersion = require('../../src/lib/getNodeVersion'); | ||
const pkg = require('../../package.json'); | ||
const semver = require('semver'); | ||
|
||
describe('#getNodeVersion()', () => { | ||
it('should extract version that matches range in package.json', () => { | ||
const version = parseInt(getNodeVersion(), 10); | ||
const cleanedVersion = semver.valid(semver.coerce(version)); | ||
expect(semver.satisfies(cleanedVersion, pkg.engines.node)).toBe(true); | ||
}); | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#! /usr/bin/env node | ||
|
||
const getNodeVersion = require('../src/lib/getNodeVersion'); | ||
const pkg = require('../package.json'); | ||
|
||
const name1 = 'RDME_VERSION'; | ||
const name2 = 'NODE_VERSION'; | ||
|
||
/** | ||
* Sets output parameters for GitHub Actions workflow | ||
* Docs: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter | ||
*/ | ||
console.log(`::set-output name=${name1}::${pkg.version}`); // eslint-disable-line no-console | ||
console.log(`::set-output name=${name2}::${getNodeVersion()}`); // eslint-disable-line no-console |
Oops, something went wrong.