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

Fixed docs deployment. #138

Merged
merged 4 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions .github/workflows/test-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Test Docs
on:
pull_request:
branches:
- 'main'
- 'feature/**'

jobs:
Expand All @@ -22,6 +23,10 @@ jobs:
run: npm install
working-directory: '${{ github.workspace }}/docs'

- name: Build documentation site
run: npm run build
working-directory: '${{ github.workspace }}/docs'

- name: Run tests
run: npm run test
working-directory: '${{ github.workspace }}/docs'
Expand Down
20 changes: 18 additions & 2 deletions docs/docs/documentation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,25 @@ own project.
The [configuration file](https://github.com/AlexSkrypnyk/scaffold/blob/main/docs/docusaurus.config.js)
allows to adjust the documentation to your needs.

## Publishing
## Publishing to Netlify on pull requests

Documentation is published to GitHub Pages using
Documentation is published to Netlify on every pull request using
the [Deploy Docs to GitHub Pages](https://github.com/AlexSkrypnyk/scaffold/blob/main/.github/workflows/docs.yml)
GitHub Action.

Deployed documentation link will be added to the pull request as a comment.

### Netlify configuration

Set up a new site on Netlify and add the following environment variables
to the `Secrets and variables > Actions > Repository secrets` in GitHub settings:

- `NETLIFY_SITE_ID` - `Site > Site configuration > General > Site details > Site information > Site ID`
- `NETLIFY_AUTH_TOKEN` - `User settings > Applications > Personal access tokens > New access token`

## Publishing to GitHub pages on release

Documentation is published to GitHub Pages on release (tag) using
the [Deploy Docs to GitHub Pages](https://github.com/AlexSkrypnyk/scaffold/blob/main/.github/workflows/docs.yml)
GitHub Action.

Expand Down
2 changes: 1 addition & 1 deletion docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const config = {
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
// Replace with your project's social card
image: 'img/scaffold-social-card.jpg',
image: 'img/social-card.jpg',
navbar: {
logo: {
alt: 'Scaffold Logo',
Expand Down
3 changes: 2 additions & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"clear": "docusaurus clear",
"serve": "docusaurus serve",
"write-translations": "docusaurus write-translations",
"write-heading-ids": "docusaurus write-heading-ids"
"write-heading-ids": "docusaurus write-heading-ids",
"test": "echo Would run docs tests"
},
"dependencies": {
"@docusaurus/core": "3.1.1",
Expand Down
Binary file removed docs/static/img/scaffold-social-card.jpg
Binary file not shown.
Binary file added docs/static/img/social-card.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading