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

[Documentation] Add documentation for contributing #16

Merged
merged 10 commits into from
Dec 17, 2023
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
38 changes: 27 additions & 11 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
# Using a different branch name? Replace `main` with your branch’s name
push:
branches: [main]
pull_request:
branches:
- main
# Allows you to run this workflow manually from the Actions tab on GitHub.
workflow_dispatch:

Expand All @@ -20,23 +23,36 @@ jobs:
steps:
- name: Checkout your repository using git
uses: actions/checkout@v3
- name: Install, build, and upload your site
uses: withastro/action@v1
- name: Setup pnpm
uses: pnpm/action-setup@v2.4.0
with:
path: /docs
package-manager: pnpm@latest
# with:
# path: . # The root location of your Astro project inside the repository. (optional)
# node-version: 18 # The specific version of Node that should be used to build your site. Defaults to 18. (optional)
# package-manager: pnpm@latest # The Node package manager that should be used to install dependencies and build your site. Automatically detected based on your lockfile. (optional)

version: 8.x
- name: Install dependencies
run: cd docs && pnpm install
- name: Build
run: cd docs && pnpm build
- name: Upload artifacts
uses: actions/upload-pages-artifact@v2.0.0
with:
path: docs/dist/

deploy:
# Add a dependency to the build job
needs: build
runs-on: ubuntu-latest

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
uses: actions/deploy-pages@v3 # or specific "vX.X.X" version tag for this action
14 changes: 14 additions & 0 deletions docs/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,20 @@ export default defineConfig({
{ label: "Hosting", link: "/guides/hosting/" },
],
},
{
label: "Contribution",
items: [
// Each item here is one entry in the navigation menu.
{
label: "Development",
link: "/contribution/development/",
},
{
label: "Contributing",
link: "/contribution/contributing/",
},
],
},
],
}),
],
Expand Down
18 changes: 18 additions & 0 deletions docs/src/content/docs/contribution/contributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: Contributing
description: How to help develop the go-fast-cdn.
---

## Go-fast CDN

You can access the source code on [Github](https://github.com/kevinanielsen/go-fast-cdn/), where everyone is encouraged to help in any way they can to make this project better. While you might not be able to contribute to the features of this project, you can still contribute by writing tests, fixing bugs or even fixing typos.

If that is not possible, you can still help by contributing to the [Documentation](#documentation). Even just leaving a star or sharing the project is a great way to contribute.

If you want to report a bug or request a feature, you can go ahead and create a new issue on GitHub, where a template is laid out, and encouraged to be used. If you want to fix a bug or implement a new feature, go ahead and open a pull request with your suggestion.

Please read the [Development Guide](/contribution/development) to learn more about how to develop on this project.

## Documentation

[Github](https://github.com/kevinanielsen/go-fast-cdn/) Is a monorepo, where the documentation can be found in the /docs directory. If you want to request documentation for a feature, go ahead and create a new issue on Github, if you have the solution for an issue or want to edit the documentation, go ahead and fork the project, and when you are ready, open a new pull request.
54 changes: 54 additions & 0 deletions docs/src/content/docs/contribution/development.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
title: Development
description: How to help develop the go-fast-cdn.
---

## Installation

### Cloning the repo

You can clone this repo with either of the following commands:

```bash title="SSH"
git clone git@github.com:kevinanielsen/go-fast-cdn
```

```bash title="HTTPS"
git clone https://github.com:kevinanielsen/go-fast-cdn
```

### Setting up the project

This project uses [dotenv](https://dotenv.org) and you can access the `.env.example` [here](https://vault.dotenv.org/project/vlt_a602c18fc8f8fd898bfacba2ed8715a9deca301c87e06fbb3ea2cde40c41e109/example). You can go ahead and copy that, and insert it into your `.env` file.

## Building

This project uses a makefile, and you can use that to build the binaries.

```bash
make prep # install dependencies
make clean # clean the output files (don't use if first time building)
make build # build the binaries
```

This will cross-compile to windows, darwin, and linux binaries, so make sure that you have the compilers installed on your machine if you run `make build`. If you don't have the compiler installed, instead run

```bash
go build .
```

### Running

Your binary should now be built and you can run it with one of the following commands, depending on your system:

```sh title="Windows"
.\bin\go-fast-cdn-windows
```

```bash title="MacOS"
/bin/go-fast-cdn-darwin
```

```bash title="Linux"
/bin/go-fast-cdn-linux
```
6 changes: 5 additions & 1 deletion docs/src/content/docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ hero:
file: ../../assets/gopher.png
actions:
- text: How to use
link: /guides/usage/
link: /go-fast-cdn/guides/usage/
icon: right-arrow
variant: primary
- text: Leave a star on Github
Expand All @@ -32,4 +32,8 @@ import { Card, CardGrid } from "@astrojs/starlight/components";
[Click here](/guides/hosting) to learn how to host your CDN for free in a
docker container.
</Card>
<Card title="Contribute" icon="pen">
[Contribute](/contribution/contributing) to this project. All help is
welcome - Translation, bug fixing, testing, enhancements etc.
</Card>
</CardGrid>
11 changes: 0 additions & 11 deletions docs/src/content/docs/reference/example.md

This file was deleted.

Loading