Skip to content

Commit 8f1b90e

Browse files
committed
Update docs configuration
1 parent 359af5a commit 8f1b90e

3 files changed

Lines changed: 18 additions & 18 deletions

File tree

.github/workflows/publish-docs.yml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Deploys the Docusaurus docs to GitHub Pages (gh-pages branch).
2+
# Enable in repo: Settings → Pages → Source: Deploy from a branch → Branch: gh-pages → / (root)
13
on:
24
push:
35
branches:
@@ -15,29 +17,22 @@ jobs:
1517
run:
1618
working-directory: docs
1719
steps:
18-
- uses: actions/checkout@v2
19-
- uses: actions/setup-node@v3
20+
- uses: actions/checkout@v4
21+
- uses: actions/setup-node@v4
2022
with:
21-
node-version: 16.x
23+
node-version: 20
2224
cache: yarn
25+
cache-dependency-path: docs/yarn.lock
2326

2427
- name: Install dependencies
2528
run: yarn install --frozen-lockfile
2629
- name: Build website
2730
run: yarn build
2831

29-
# Popular action to deploy to GitHub Pages:
30-
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
3132
- name: Deploy to GitHub Pages
3233
uses: peaceiris/actions-gh-pages@v3
3334
with:
3435
github_token: ${{ secrets.GITHUB_TOKEN }}
35-
# Build output to publish to the `gh-pages` branch:
3636
publish_dir: ./docs/build
37-
# The following lines assign commit authorship to the official
38-
# GH-Actions bot for deploys to `gh-pages` branch:
39-
# https://github.com/actions/checkout/issues/13#issuecomment-724415212
40-
# The GH actions bot is used by default if you didn't specify the two fields.
41-
# You can swap them out with your own user credentials.
4237
user_name: github-actions[bot]
4338
user_email: 41898282+github-actions[bot]@users.noreply.github.com

docs/README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,22 @@ $ yarn build
2424

2525
This command generates static content into the `build` directory and can be served using any static contents hosting service.
2626

27-
### Deployment
27+
### Deployment (GitHub Pages)
2828

29-
Using SSH:
29+
The site is deployed to GitHub Pages via the `publish-docs` workflow on push to `main` (when `docs/**` or the workflow file change). The site is published to the `gh-pages` branch.
30+
31+
**Repo setup:** In GitHub go to **Settings → Pages → Build and deployment**: Source = **Deploy from a branch**, Branch = **gh-pages**, Folder = **/ (root)**. The site will be available at:
32+
33+
`https://doublesymmetry.github.io/react-native-track-player/`
34+
35+
To deploy manually (e.g. with SSH):
3036

3137
```
3238
$ USE_SSH=true yarn deploy
3339
```
3440

35-
Not using SSH:
41+
Or with a Git user:
3642

3743
```
3844
$ GIT_USER=<Your GitHub username> yarn deploy
3945
```
40-
41-
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.

docs/docusaurus.config.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ const darkCodeTheme = require('prism-react-renderer/themes/dracula');
88
const config = {
99
title: 'React Native Track Player',
1010
tagline: 'A fully fledged audio module created for music apps',
11-
url: 'https://rntp.dev',
12-
baseUrl: '/',
11+
// GitHub Pages project site: https://<org>.github.io/<repo>/
12+
url: 'https://doublesymmetry.github.io',
13+
baseUrl: '/react-native-track-player/',
1314
onBrokenLinks: 'throw',
1415
onBrokenMarkdownLinks: 'warn',
1516
favicon: 'img/logo.png',

0 commit comments

Comments
 (0)