Skip to content

Commit fd4fbb5

Browse files
authored
Merge pull request #219 from pluginpal/feature/docs
Feature/docs
2 parents f28fc39 + f7867fb commit fd4fbb5

File tree

215 files changed

+24691
-10739
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

215 files changed

+24691
-10739
lines changed

.changeset/config.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
{ "repo": "pluginpal/strapi-webtools" }
66
],
77
"commit": false,
8+
"privatePackages": {
9+
"version": true,
10+
"tag": true
11+
},
812
"fixed": [],
913
"linked": [],
1014
"access": "public",

.changeset/sweet-ravens-travel.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"docs": major
3+
---
4+
5+
Move the documentation to the strapi-webtools monorepo

.github/workflows/deploy-docs.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Deploy Docs
2+
3+
on:
4+
push:
5+
tags:
6+
- "docs@*"
7+
8+
jobs:
9+
deploy:
10+
name: Deploy
11+
runs-on: ubuntu-latest
12+
environment:
13+
name: docs.pluginpal.io
14+
url: https://docs.pluginpal.io/webtools
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v3
18+
19+
- name: Set up Docker
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: '14'
23+
24+
- name: Build a Docker image
25+
run: |
26+
cd packages/docs
27+
docker build \
28+
-t docs-webtools:latest .
29+
docker save -o docs-webtools-latest.tar docs-webtools:latest
30+
31+
- name: Transfer the Docker image to the Dokku server
32+
uses: appleboy/[email protected]
33+
with:
34+
host: ${{ secrets.SSH_HOST }}
35+
username: ${{ secrets.SSH_CI_USERNAME }}
36+
password: ${{ secrets.SSH_CI_PASSWORD }}
37+
source: packages/docs/docs-webtools-latest.tar
38+
target: /var/lib/dokku/data/storage/docs/docker-images
39+
40+
- name: Deploy the Dokku app based on the Docker image
41+
uses: appleboy/[email protected]
42+
with:
43+
host: ${{ secrets.SSH_HOST }}
44+
username: ${{ secrets.SSH_CI_USERNAME }}
45+
password: ${{ secrets.SSH_CI_PASSWORD }}
46+
script_stop: true
47+
script: |
48+
sudo docker load -i /var/lib/dokku/data/storage/docs/docker-images/docs-webtools-latest.tar
49+
DOCS_WEBTOOLS_LATEST_IMAGE=$(sudo docker images --format "{{.ID}}" docs-webtools:latest)
50+
sudo docker tag docs-webtools:latest docs-webtools:$DOCS_WEBTOOLS_LATEST_IMAGE
51+
dokku git:from-image docs-webtools docs-webtools:$DOCS_WEBTOOLS_LATEST_IMAGE
52+
sudo docker system prune --all --force
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Deploy
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
deploy:
11+
name: Deploy
12+
runs-on: ubuntu-latest
13+
environment:
14+
name: docs.pluginpal.io
15+
url: https://docs.pluginpal.io
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v3
19+
20+
- name: Set up Docker
21+
uses: actions/setup-node@v3
22+
with:
23+
node-version: '14'
24+
25+
- name: Build a Docker image
26+
run: |
27+
docker build \
28+
-t pluginpal-docs:latest .
29+
docker save -o pluginpal-docs-latest.tar pluginpal-docs:latest
30+
31+
- name: Transfer the Docker image to the Dokku server
32+
uses: appleboy/[email protected]
33+
with:
34+
host: ${{ secrets.SSH_HOST }}
35+
username: ${{ secrets.SSH_CI_USERNAME }}
36+
password: ${{ secrets.SSH_CI_PASSWORD }}
37+
source: pluginpal-docs-latest.tar
38+
target: /var/lib/dokku/data/storage/docs/docker-images
39+
40+
- name: Deploy the Dokku app based on the Docker image
41+
uses: appleboy/[email protected]
42+
with:
43+
host: ${{ secrets.SSH_HOST }}
44+
username: ${{ secrets.SSH_CI_USERNAME }}
45+
password: ${{ secrets.SSH_CI_PASSWORD }}
46+
script_stop: true
47+
script: |
48+
sudo docker load -i /var/lib/dokku/data/storage/docs/docker-images/pluginpal-docs-latest.tar
49+
DOCS_LATEST_IMAGE=$(sudo docker images --format "{{.ID}}" pluginpal-docs:latest)
50+
sudo docker tag pluginpal-docs:latest pluginpal-docs:$DOCS_LATEST_IMAGE
51+
dokku git:from-image docs pluginpal-docs:$DOCS_LATEST_IMAGE
52+
sudo docker system prune --all --force

packages/docs/.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Dependencies
2+
/node_modules
3+
4+
# Production
5+
/build
6+
7+
# Generated files
8+
.docusaurus
9+
.cache-loader
10+
11+
# Misc
12+
.DS_Store
13+
.env.local
14+
.env.development.local
15+
.env.test.local
16+
.env.production.local
17+
18+
npm-debug.log*
19+
yarn-debug.log*
20+
yarn-error.log*
698 Bytes
Binary file not shown.

packages/docs/Dockerfile

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# syntax=docker/dockerfile:1
2+
3+
# Stage 1: Base image.
4+
## Start with a base image containing NodeJS so we can build Docusaurus.
5+
FROM node:lts as base
6+
## Disable colour output from yarn to make logs easier to read.
7+
ENV FORCE_COLOR=0
8+
## Enable corepack.
9+
RUN corepack enable
10+
## Set the working directory to `/opt/docusaurus`.
11+
WORKDIR /opt/docusaurus
12+
13+
# Stage 2b: Production build mode.
14+
FROM base as prod
15+
## Set the working directory to `/opt/docusaurus`.
16+
WORKDIR /opt/docusaurus
17+
## Copy over the source code.
18+
COPY . /opt/docusaurus/
19+
## Install dependencies with `--immutable` to ensure reproducibility.
20+
RUN yarn install --immutable
21+
## Build the static site.
22+
RUN yarn build
23+
24+
# Stage 3a: Serve with `docusaurus serve`.
25+
FROM prod as serve
26+
## Expose the port that Docusaurus will run on.
27+
EXPOSE 3000
28+
## Run the production server.
29+
CMD ["yarn", "serve", "--host", "0.0.0.0", "--no-open"]

packages/docs/README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Website
2+
3+
This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.
4+
5+
### Installation
6+
7+
```
8+
$ yarn
9+
```
10+
11+
### Local Development
12+
13+
```
14+
$ yarn start
15+
```
16+
17+
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
18+
19+
### Build
20+
21+
```
22+
$ yarn build
23+
```
24+
25+
This command generates static content into the `build` directory and can be served using any static contents hosting service.
26+
27+
### Deployment
28+
29+
Using SSH:
30+
31+
```
32+
$ USE_SSH=true yarn deploy
33+
```
34+
35+
Not using SSH:
36+
37+
```
38+
$ GIT_USER=<Your GitHub username> yarn deploy
39+
```
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.

packages/docs/babel.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
3+
};
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
slug: first-blog-post
3+
title: First Blog Post
4+
authors: [slorber, yangshun]
5+
tags: [hola, docusaurus]
6+
---
7+
8+
Lorem ipsum dolor sit amet...
9+
10+
<!-- truncate -->
11+
12+
...consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet

0 commit comments

Comments
 (0)