Skip to content

Commit

Permalink
docs: publish "homepage" to GitHub Pages (#259)
Browse files Browse the repository at this point in the history
## Motivation

* Automatically build and publish our "homepage" to GitHub Pages

## Issues closed

<!-- List closed issues here -->
  • Loading branch information
TimPietrusky authored May 3, 2024
1 parent 6b2b9ee commit e5f31d8
Show file tree
Hide file tree
Showing 10 changed files with 1,001 additions and 705 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/publish-homepage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Publish the homepage to GitHub Pages

on:
workflow_dispatch:
push:
branches:
- "alpha"

jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "npm"

- name: Install the dependencies for Captain
run: npm ci

- name: Build the type docs for Captain
run: npm run typedoc:generate

- name: Install the dependencies for the homepage
run: npm ci
working-directory: homepage

- name: Build the homepage
run: npm run build
working-directory: homepage

- name: Deploy the homepage to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./homepage/build
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ playwright-report
.nyc_output
.pytest_cache


# homepage
homepage/docs
29 changes: 12 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
</a>
</div>


<p align="center">
Explore, create, and innovate with Captain, your all-in-one platform to build and use AI
apps effortlessly on your own computer.
Expand Down Expand Up @@ -57,17 +56,16 @@ Captain's core apps transform your thoughts into vivid artworks and captivating

<!-- toc -->

- [Getting Started](#getting-started)
* [Prerequisites](#prerequisites)
* [Installation](#installation)
- [First steps](#first-steps)
* [Download models](#download-models)
* [Navigate Captain with a Prompt](#navigate-captain-with-a-prompt)
* [Generate a Story](#generate-a-story)
- [Community](#community)
- [Contribute](#contribute)
- [License](#license)
- [Acknowledgments](#acknowledgments)
- [Getting Started](#getting-started)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [First steps](#first-steps)
- [Download models](#download-models)
- [Navigate Captain with a Prompt](#navigate-captain-with-a-prompt)
- [Generate a Story](#generate-a-story)
- [Community](#community)
- [Contribute](#contribute)
- [Acknowledgments](#acknowledgments)

<!-- tocstop -->

Expand Down Expand Up @@ -146,11 +144,8 @@ Let's connect and tell us what you think about Captain:
## Contribute

Join us on deck! If you're looking to contribute, our
[Contribution Guidelines](https://github.com/blib-la/captain/blob/alpha/.github/CONTRIBUTING.md) will help you get started.

## License

Captain is proudly open source, available under the [AGPL 3.0 License](./LICENSE).
[Contribution Guidelines](https://github.com/blib-la/captain/blob/alpha/.github/CONTRIBUTING.md)
will help you get started.

## Acknowledgments

Expand Down
30 changes: 15 additions & 15 deletions homepage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,37 @@ This website is built using [Docusaurus](https://docusaurus.io/), a modern stati
### Installation

```
$ yarn
npm i
```

### Local Development

```
$ yarn start
npm start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
This command starts a local development server and opens up a browser window. Most changes are
reflected live without having to restart the server.

### Build

First you have to create the `docs` from Captain inside the root of Captain itself, not in
`homepage`:

```
$ yarn build
cd ..
npm run typedoc:generate
```

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

### Deployment

Using SSH:
Then you can go back into `homepage` and build it:

```
$ USE_SSH=true yarn deploy
npm run build
```

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

```
$ GIT_USER=<Your GitHub username> yarn deploy
```
### Deployment

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.
Is done via a [GitHub workflow](../.github/workflows/publish-homepage.yml).
Loading

0 comments on commit e5f31d8

Please sign in to comment.