Skip to content

Commit 1b43e3b

Browse files
committed
feat: add github pages deployment
- add workflow to deploy ./web to github pages - document that web assets are served as-is without build - note backend requires manual deployment via waterworks-infra
1 parent 6ebed8c commit 1b43e3b

File tree

3 files changed

+106
-4
lines changed

3 files changed

+106
-4
lines changed

.github/workflows/deploy-pages.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Deploy to GitHub Pages
2+
# Deploys pre-built static files from web/ directory
3+
# No build step required - files are used as-is
4+
5+
name: Deploy to GitHub Pages
6+
7+
permissions:
8+
contents: read
9+
pages: write
10+
id-token: write
11+
12+
on:
13+
push:
14+
branches:
15+
- main
16+
workflow_dispatch:
17+
18+
concurrency:
19+
group: "pages"
20+
cancel-in-progress: false
21+
22+
jobs:
23+
deploy:
24+
environment:
25+
name: github-pages
26+
url: ${{ steps.deployment.outputs.page_url }}
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v4
31+
32+
- name: Upload artifact
33+
uses: actions/upload-pages-artifact@v3
34+
with:
35+
path: './web'
36+
37+
- name: Deploy to GitHub Pages
38+
id: deployment
39+
uses: actions/deploy-pages@v4

README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,19 @@ Learn available variables via `./ipfs-check --help`
3939

4040
### Frontend
4141

42-
There are web assets in `web` that interact with the Go HTTP server that can be deployed however you deploy web assets.
43-
Maybe just deploy it on IPFS and reference it with DNSLink.
42+
The web assets in `./web` directory are embedded directly into the Go binary and served as-is. No build step is required for deployment - the pre-built CSS and static files are already committed to the repository.
4443

45-
For anything other than local testing you're going to want to have a proxy to give you HTTPS support on the Go server.
44+
The latest version from the `main` branch is automatically deployed to https://check.ipfs.network for convenience.
4645

47-
At a minimum, the following files should be available from your web-server on prod: `web/index.html`, `web/tachyons.min.css`.
46+
If you need to modify the web interface styles:
47+
1. Make changes to `web/input.css`
48+
2. Run `npm ci` and `npm run build` in the `web` directory (see `web/README.md` for details)
49+
3. Commit the updated `web/output.css` file
50+
51+
> [!IMPORTANT]
52+
> Breaking changes to the HTTP API or frontend MUST be avoided. The new `./web` should always work with old backend versions to ensure compatibility.
53+
54+
For production deployments, you'll want a proxy for HTTPS support on the Go server.
4855

4956

5057
## Running locally

web/README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# ipfs-check Web Interface
2+
3+
This directory contains the static web assets for ipfs-check.
4+
5+
## Deployment
6+
7+
`./web` is automatically deployed to https://check.ipfs.network via GitHub Pages.
8+
9+
Backend updates require manual deployment via `ipshipyard/waterworks-infra` ([example](https://github.com/ipshipyard/waterworks-infra/pull/740)).
10+
11+
## Architecture
12+
13+
The files in this directory are embedded directly into the Go binary and served as-is. No build step is required for normal deployment since the compiled CSS (`output.css`) is already committed to the repository.
14+
15+
## Development
16+
17+
### Prerequisites
18+
19+
- Node.js and npm (only needed for modifying styles)
20+
21+
### Modifying Styles
22+
23+
The project uses Tailwind CSS for styling. If you need to make style changes:
24+
25+
1. Install dependencies (one-time setup):
26+
```bash
27+
npm ci
28+
```
29+
30+
2. For development with live CSS updates:
31+
```bash
32+
npm run dev
33+
```
34+
This watches `input.css` for changes and automatically rebuilds `output.css`
35+
36+
3. For production build (minified CSS):
37+
```bash
38+
npm run build
39+
```
40+
41+
4. **Important**: After making style changes, commit the updated `output.css` file
42+
43+
### Files
44+
45+
- `index.html` - Main HTML file
46+
- `script.js` - JavaScript logic for the check interface
47+
- `input.css` - Source Tailwind CSS file (modify this for style changes)
48+
- `output.css` - Compiled CSS (auto-generated, but committed to git)
49+
- `favicon.ico` - Site favicon
50+
- `fonts/` - Custom fonts
51+
52+
### Notes
53+
54+
- The `output.css` file is intentionally committed to version control
55+
- This allows the Go binary to embed and serve the web interface without requiring a build step
56+
- Only run `npm ci` and `npm run build` if you're modifying the styles

0 commit comments

Comments
 (0)