build: publish docs to cloudflare pages (#5230)

This commit is contained in:
Oleg Lobanov 2025-06-28 22:20:26 +02:00 committed by GitHub
parent a5ea2a266b
commit 8861933cf8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
20 changed files with 46 additions and 34 deletions

View File

@ -4,5 +4,4 @@ dist
frontend/node_modules
frontend/dist
filebrowser.db
site/docs/index.md
site/docs/quickstart.md
docs/index.md

View File

@ -38,3 +38,28 @@ jobs:
tags: |
filebrowser/site:latest
ghcr.io/filebrowser/site:latest
deploy:
permissions:
contents: read
deployments: write
pull-requests: write
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build site
run: make site
- name: Deploy to Cloudflare Pages
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy site/public/site --project-name=${{ secrets.CLOUDFLARE_PROJECT_NAME }}
gitHubToken: ${{ secrets.GITHUB_TOKEN }}

View File

@ -7,8 +7,8 @@ COPY LICENSE /build/docs/LICENSE
COPY site/ /build/
COPY docs/ /build/docs/docs
COPY README.md /build/docs/index.md
RUN sed -i 's|site/docs/||g' /build/docs/index.md
RUN mkdocs build

View File

@ -5,15 +5,11 @@ RUN apk add --no-cache inotify-tools
WORKDIR /build
COPY site/requirements.txt /build/requirements.txt
COPY site/ /build/
RUN pip install --no-cache-dir -r requirements.txt
# Expose the port for mkdocs serve
EXPOSE 8000
# Copy the watch script and make it executable
COPY scripts/watch.sh /usr/local/bin/watch.sh
RUN chmod +x /usr/local/bin/watch.sh
# The entrypoint will run the initial setup and then start the server.
ENTRYPOINT ["/usr/local/bin/watch.sh"]
ENTRYPOINT ["mkdocs", "serve", "-a", "0.0.0.0:8000", "--dirtyreload"]

View File

@ -55,7 +55,7 @@ bump-version: $(standard-version) ## Bump app version
.PHONY: site
site: ## Build site
@rm -f site/public/*
@rm -rf site/public/site*
@docker rm -f spot-site
docker build -f Dockerfile.site --progress=plain -t filebrowser.site .
docker run -d --name=filebrowser-site filebrowser.site
@ -66,7 +66,7 @@ site: ## Build site
.PHONY: site-serve
site-serve: ## Serve site for development
docker build -f Dockerfile.site.dev -t filebrowser.site.dev .
docker run --rm -it -p 8000:8000 -v $(CURDIR)/site:/build/ -v $(CURDIR)/README.md:/tmp/README.md filebrowser.site.dev
docker run --rm -it -p 8000:8000 -v $(CURDIR)/docs:/build/docs/docs -v $(CURDIR)/README.md:/build/docs/index.md filebrowser.site.dev
## Help:
help: ## Show this help

View File

@ -1,10 +1,4 @@
---
hide:
- navigation
- toc
---
#
<p align="center">
<img src="https://raw.githubusercontent.com/filebrowser/logo/master/banner.png" width="550"/>
</p>
@ -38,21 +32,21 @@ File Browser is a **create-your-own-cloud-kind** of software where you can insta
| Easy Login System | Sleek Interface | User Management |
| :----------------------: | :----------------------: | :----------------------: |
| ![](./site/docs/assets/1.jpg) | ![](./site/docs/assets/2.jpg) | ![](./site/docs/assets/3.jpg) |
| ![](docs/assets/1.jpg) | ![](docs/assets/2.jpg) | ![](docs/assets/3.jpg) |
| File Editing | Custom Commands | Customization |
| :----------------------: | :----------------------: | :----------------------: |
| ![](./site/docs/assets/4.jpg) | ![](./site/docs/assets/5.jpg) | ![](./site/docs/assets/6.jpg) |
| ![](docs/assets/4.jpg) | ![](docs/assets/5.jpg) | ![](docs/assets/6.jpg) |
## Install
For information on how to install File Browser, please check [installation](./site/docs/installation.md).
For information on how to install File Browser, please check [installation](docs/installation.md).
## Configuration
For information on how to configure File Browser, please check [configuration](./site/docs/configuration.md).
For information on how to configure File Browser, please check [configuration](docs/configuration.md).
## Contributing
For information on how to contribute to the project, including how translations are managed, please check [contributing](./site/docs/contributing.md).
For information on how to contribute to the project, including how translations are managed, please check [contributing](docs/contributing.md).

View File

Before

Width:  |  Height:  |  Size: 65 KiB

After

Width:  |  Height:  |  Size: 65 KiB

View File

Before

Width:  |  Height:  |  Size: 116 KiB

After

Width:  |  Height:  |  Size: 116 KiB

View File

Before

Width:  |  Height:  |  Size: 151 KiB

After

Width:  |  Height:  |  Size: 151 KiB

View File

Before

Width:  |  Height:  |  Size: 212 KiB

After

Width:  |  Height:  |  Size: 212 KiB

View File

Before

Width:  |  Height:  |  Size: 130 KiB

After

Width:  |  Height:  |  Size: 130 KiB

View File

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 60 KiB

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

@ -42,7 +42,7 @@ The icons are cached, to make the new ones appear more quickly open developer to
## Authentication Method
Right now, there are three possible authentication methods. Each one of them has its own capabilities and specification. If you are interested in contributing with one more authentication method, please [check the guidelines](./contributing.md).
Right now, there are three possible authentication methods. Each one of them has its own capabilities and specification. If you are interested in contributing with one more authentication method, please [check the guidelines](contributing.md).
### JSON Auth (default)

View File

@ -1,6 +1,6 @@
# Contributing
If you're interested in contributing to this project, this is the best place to start. Before contributing to this project, please take a bit of time to read our [Code of Conduct](./code-of-conduct.md). Also, note that this project is open-source and licensed under [Apache License 2.0](../LICENSE).
If you're interested in contributing to this project, this is the best place to start. Before contributing to this project, please take a bit of time to read our [Code of Conduct](code-of-conduct.md). Also, note that this project is open-source and licensed under [Apache License 2.0](../LICENSE).
## Project Structure

View File

@ -5,15 +5,15 @@ site_url: 'https://filebrowser.org'
repo_name: 'filebrowser/filebrowser'
repo_url: 'https://github.com/filebrowser/filebrowser'
edit_uri: 'edit/master/site/docs/'
edit_uri: 'edit/master/docs/'
copyright: 'Copyright &copy; 2025 Filebrowser Community'
theme:
name: material
language: en
logo: logo.png
favicon: favicon.png
logo: docs/assets/logo.png
favicon: docs/assets/favicon.png
palette:
- scheme: default
primary: blue
@ -44,8 +44,6 @@ theme:
- search.highlight
- search.share
- content.code.copy
- content.action.edit
- content.action.view
- toc.follow
- toc.integrate
@ -113,9 +111,9 @@ extra:
nav:
- Home: index.md
- Getting Started:
- Installation: installation.md
- Configuration: configuration.md
- Security: security.md
- Installation: docs/installation.md
- Configuration: docs/configuration.md
- Security: docs/security.md
- Contributing:
- Contributing: contributing.md
- Code of Conduct: code-of-conduct.md
- Contributing: docs/contributing.md
- Code of Conduct: docs/code-of-conduct.md