diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index f57092c..4981ed5 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -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: @@ -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 diff --git a/docs/astro.config.mjs b/docs/astro.config.mjs index 34f786d..8a3d345 100644 --- a/docs/astro.config.mjs +++ b/docs/astro.config.mjs @@ -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/", + }, + ], + }, ], }), ], diff --git a/docs/src/content/docs/contribution/contributing.md b/docs/src/content/docs/contribution/contributing.md new file mode 100644 index 0000000..1bf2bef --- /dev/null +++ b/docs/src/content/docs/contribution/contributing.md @@ -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. diff --git a/docs/src/content/docs/contribution/development.md b/docs/src/content/docs/contribution/development.md new file mode 100644 index 0000000..d3c0d31 --- /dev/null +++ b/docs/src/content/docs/contribution/development.md @@ -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 +``` diff --git a/docs/src/content/docs/index.mdx b/docs/src/content/docs/index.mdx index caf75f5..5f33ab6 100644 --- a/docs/src/content/docs/index.mdx +++ b/docs/src/content/docs/index.mdx @@ -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 @@ -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. + + [Contribute](/contribution/contributing) to this project. All help is + welcome - Translation, bug fixing, testing, enhancements etc. + diff --git a/docs/src/content/docs/reference/example.md b/docs/src/content/docs/reference/example.md deleted file mode 100644 index ac8cfa8..0000000 --- a/docs/src/content/docs/reference/example.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: Example Reference -description: A reference page in my new Starlight docs site. ---- - -Reference pages are ideal for outlining how things work in terse and clear terms. -Less concerned with telling a story or addressing a specific use case, they should give a comprehensive outline of what your documenting. - -## Further reading - -- Read [about reference](https://diataxis.fr/reference/) in the Diátaxis framework