diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index e00e3a6..7a31bc0 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -24,7 +24,20 @@ jobs: run: pnpm install - name: Build run: pnpm build - - name: Publish + - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: path: docs/out/ + deploy: + needs: build + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file diff --git a/README.md b/README.md index bdf3674..184603b 100644 --- a/README.md +++ b/README.md @@ -18,126 +18,9 @@ Cup is the easiest way to check for container image updates. - The binary is tiny! At the time of writing it's just 4.7 MB. No more pulling 100+ MB docker images for a such a simple program. - JSON output for both the CLI and web interface so you can connect Cup to integrations. It's easy to parse and makes webhooks and pretty dashboards simple to set up! -## Installation +## Documentation -You can install Cup in 2 ways: as a docker container (recommended) or as a binary. - -### With docker - -Requirements: [Docker](https://docs.docker.com/engine/install/) - -Difficulty: Easy - -- Open a terminal and run `docker pull ghcr.io/sergi0g/cup`. If you're not in the `docker` group, make sure to prefix the command as root. - -That's it! Now head over to the Usage section! - -### From source - -Requirements: [Rust](https://rustup.rs) - -Difficulty: Moderate - -1. Open a terminal and clone the git repository - ``` - $ git clone https://github.com/sergi0g/cup - ``` -2. Change your directory to the repository you just cloned - ``` - $ cd cup - ``` -3. Build Cup - ``` - $ cargo build --release - ``` - This will build cup with all features by default. If you want to build just the server, you can append `--no-default-features --features cli` or `--no-default-features --features server` depending one what you need. -4. Add the binary to your path for easy access - - Consult your shell's documentation on how to do this. For Bash, the following will likely work: - - ``` - $ mv /target/release/cup ~/.local/bin - ``` - - Make sure to reload your shell. - - You're now ready to use Cup! - -## Usage - -### CLI - -Cup's CLI provides the `cup check` command. - -Basic usage: - -``` -$ cup check -nginx:alpine Update available -redis:7 Update available -redis:alpine Update available -... -centos:7 Up to date -mcr.microsoft.com/devcontainers/go:0-1.19-bullseye Up to date -rockylinux:9-minimal Up to date -rabbitmq:3.11.9-management Up to date -... -some/deleted:image Unknown -``` - -If you have a [Nerd Font](https://nerdfonts.com) installed, you can also add icons with the `-i` flag: `cup check -i` - -If you want the output to be JSON, use the `-r` flag: - -``` -$ cup check -r -[{"image":"nginx:alpine","has_update":true},{"image":"rockylinux:9-minimal","has_update":false},{"image":"some/deleted:image","has_update":null}] -``` - -Checking a single image is also possible: - -``` -$ cup check node:latest -node:latest has an update available -``` - -If using the docker image: - -``` -$ docker run -v /var/run/docker.sock:/var/run/docker.sock cup check -``` - -### Server - -The server provides the `cup serve` command. - -Basic usage: - -``` -$ cup serve -Serving on http://0.0.0.0:8000 -Received GET request on / -Received GET request on /json -``` - -This will launch the server on port 8000. To access it, visit `http://:8000` (replace `` with the IP address of the machine running Cup.) - -The URL `http://:8000/json` is also available for usage with integrations. - -If you want to use a custom port, use the `-p` flag: - -``` -$ cup check -p 9000 -Serving on http://0.0.0.0:9000 -Received GET request on / -Received GET request on /json -``` - -If using the docker image (replace `` with the port you're using (default 8000)): - -``` -$ docker run -v /var/run/docker.sock:/var/run/docker.sock -p : cup serve -``` +Take a look at https://sergi0g.github.io/cup/docs/introduction! ## Limitations diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..fb55640 --- /dev/null +++ b/docs/README.md @@ -0,0 +1 @@ +This is where Cup's documentation lives. It's created with [Nextra](https://nextra.site). \ No newline at end of file diff --git a/docs/pages/_meta.json b/docs/pages/_meta.json index 94ec0ce..f77f7e1 100644 --- a/docs/pages/_meta.json +++ b/docs/pages/_meta.json @@ -9,9 +9,5 @@ "theme": { "typesetting": "article" } - }, - "index": { - "title": "Home", - "display": "hidden" } } \ No newline at end of file diff --git a/docs/pages/index.mdx b/docs/pages/index.mdx deleted file mode 100644 index 59f9f4d..0000000 --- a/docs/pages/index.mdx +++ /dev/null @@ -1,3 +0,0 @@ -# Welcome to Cup - -Hello world! \ No newline at end of file