Skip to content

Commit d40058d

Browse files
2colorlidel
andauthored
Apply suggestions from code review
Co-authored-by: Marcin Rataj <[email protected]>
1 parent 4dcb49e commit d40058d

File tree

2 files changed

+26
-24
lines changed

2 files changed

+26
-24
lines changed

docs/how-to/websites-on-ipfs/custom-domains.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ To provide access to the app directly via the custom domain, you have the follow
3131

3232
1. Self-host both the IPFS provider (e.g. [Kubo](https://github.com/ipfs/kubo)) and the HTTP gateway (e.g. [Kubo](https://github.com/ipfs/kubo) or [Rainbow](https://github.com/ipfs/rainbow/)). Deploy an IPFS Gateway that supports DNSLink resolution and point the `CNAME`/`A` DNS record for your custom domain to it and update the `TXT` record on `_dnslink` subdomain to match CID of your website. Set up CI automation to update TXT record every time your CID changes. You will likely want to also configure TLS with a reverse proxy like Caddy or use a CDN like Cloudflare for TLS termination.
3333
2. Use a service like Fleek
34-
3. Deploy the site to a web hosting service like Cloudflare/GitHub Pages, and point the CNAME/A record for your custom domain to it, essentially getting the benefits of both IPFS and traditional web hosting.
34+
3. Deploy the site to a web hosting service like [Cloudflare Pages](https://pages.cloudflare.com/) or [GitHub Pages](https://pages.github.com/), and point the `CNAME`/`A` record for your main domain and `TXT` record with CID on `_dnslink` subdomain, essentially getting the benefits of both IPFS and traditional web hosting. Remember to set up CI automation to update TXT record every time your CID changes.
3535

3636
Access via a custom domain is useful if you want to serve your app via a domain name that you own, for example, `app.example.com`.

docs/how-to/websites-on-ipfs/deploy-github-action.md

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ description: Guide on how to setup GitHub Actions to deploy static sites/apps to
55

66
# Deploy Static Apps to IPFS with GitHub Actions
77

8-
This guide will walk you through the process of configuring a GitHub Actions workflow to deploy a repository containing a static site or app to IPFS using the [IPFS Deploy Action](https://github.com/ipfs/ipfs-deploy-action).
8+
This guide will walk you through the process of configuring a [GitHub Actions](https://docs.github.com/en/actions) workflow to deploy a repository containing a static site or app to IPFS using the [IPFS Deploy Action](https://github.com/ipfs/ipfs-deploy-action).
99

10-
By the end of this guide, your app will be deployed to IPFS automatically when you push to your repository. It will also deploy pull request previews for each commit, and provide some other developer experience features, like commit status updates with the CID of the build, and a comment on pull requests with the IPFS CID and preview links.
10+
By the end of this guide, your web app (or just a static website) will be deployed to IPFS automatically when you push to your repository. It will also deploy pull request previews for each commit, and provide some other developer experience features, like commit status updates with the CID of the build, and a comment on pull requests with the IPFS CID and preview links.
1111

1212
![IPFS Deploy Action](./images/github-action/commit-status.png)
1313

@@ -20,12 +20,12 @@ To see what this looks like in a real-world example, check out the [IPNS Inspect
2020

2121
## What is the IPFS Deploy Action?
2222

23-
The IPFS Deploy Action is a [composite action](https://docs.github.com/en/actions/creating-actions/creating-a-composite-action), that can be called as a step in a GitHub Actions workflow, and combines the following features:
23+
The IPFS Deploy Action is a [composite action](https://docs.github.com/en/actions/creating-actions/creating-a-composite-action), that can be called as a step in a [GitHub Actions workflow](https://docs.github.com/en/actions/writing-workflows), and combines the following features:
2424

25-
- 📦 Merkleizes your static site into a CAR file
26-
- 🚀 Uploads CAR file to either Storacha, IPFS Cluster, or Kubo
27-
- 📍 Optional pinning to Pinata
28-
- 💾 Optional CAR file upload to Filebase
25+
- 📦 Merkleizes your static site into a [CAR](../../concepts/glossary.md#car) file
26+
- 🚀 Uploads CAR file to either [Storacha](https://storacha.network/), [IPFS Cluster](https://ipfscluster.io/), or [Kubo](https://github.com/ipfs/kubo#readme)
27+
- 📍 Optional CID pinning to [Pinata](https://pinata.cloud/)
28+
- 💾 Optional CAR file upload to [Filebase](https://filebase.com/)
2929
- 💬 PR Previews, with a comment containing the CID and preview links
3030
- ✅ Commit Status updates
3131

@@ -38,16 +38,16 @@ The IPFS Deploy Action makes no assumptions about your build process. Whether yo
3838
Before you begin, make sure you have:
3939

4040
1. A GitHub repository with your static web application
41-
2. A [Storacha](https://storacha.network) account or an IPFS Node (Kubo or IPFS Cluster) with the RPC endpoint publicly reachable (see [this guide](../kubo-rpc-tls-auth.md) for instructions on how to secure the Kubo RPC endpoint with TLS and authentication)
41+
2. A [Storacha](https://storacha.network) account or an IPFS Node ([Kubo](https://github.com/ipfs/kubo#readme) or [IPFS Cluster](https://ipfscluster.io/)) with the [Kubo RPC](../../reference/kubo/rpc.md) endpoint publicly reachable (see [this guide](../kubo-rpc-tls-auth.md) for instructions on how to secure the Kubo RPC endpoint with TLS and authentication)
4242

4343
This guide will use Storacha for simplicity. If you have an IPFS Node, you can skip the Storacha setup and use your own node instead.
4444

4545
## Step 1: Setting Up Storacha
4646

47-
If you don't have a Storacha account, you can create one at [https://storacha.network](https://storacha.network).
47+
If you don't have a Storacha account, you can create one at [storacha.network](https://storacha.network).
4848

4949

50-
1. Install the w3cli tool:
50+
1. Install the [`w3cli`](https://www.npmjs.com/package/@web3-storage/w3cli) tool:
5151

5252
```bash
5353
npm install -g @web3-storage/w3cli
@@ -77,7 +77,7 @@ If you don't have a Storacha account, you can create one at [https://storacha.ne
7777

7878
Save the key value as a GitHub secret named `STORACHA_KEY`
7979

80-
5. Create a UCAN proof. Note that the command will create a UCAN proof allowing uploads to the space created in step 3:
80+
5. Create a [UCAN](https://docs.storacha.network/concepts/ucans-and-storacha/) proof. Note that the command will create a UCAN proof allowing uploads to the space created in step 3:
8181

8282
```bash
8383
w3 delegation create did:key:YOUR_KEY_DID -c space/blob/add -c space/index/add -c filecoin/offer -c upload/add --base64
@@ -112,7 +112,7 @@ jobs:
112112
- name: Setup Node.js
113113
uses: actions/setup-node@v4
114114
with:
115-
node-version: '20'
115+
node-version: 'lts/*'
116116
cache: 'npm'
117117

118118
- name: Install dependencies
@@ -142,8 +142,8 @@ A couple of things to note:
142142

143143
To upload the CAR file to a Kubo node instead of or in addition to Storacha:
144144

145-
1. Get your Kubo RPC endpoint and API token
146-
2. Add them as GitHub secrets named `KUBO_API_URL` and `KUBO_API_AUTH`
145+
1. Get your [Kubo RPC endpoint](https://github.com/ipfs/kubo/blob/master/docs/config.md#addressesapi) and [API token](https://github.com/ipfs/kubo/blob/master/docs/config.md#apiauthorizations)
146+
2. Add them as [GitHub secrets](https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions) named `KUBO_API_URL` and `KUBO_API_AUTH`
147147
3. Add these lines to your workflow:
148148

149149
```yaml
@@ -155,7 +155,7 @@ To upload the CAR file to a Kubo node instead of or in addition to Storacha:
155155
kubo-api-auth: ${{ secrets.KUBO_API_AUTH }}
156156
```
157157

158-
You can also customize the Kubo version used for merkleizing your content:
158+
You can also customize the Kubo version and [`ipfs add` parameters](https://docs.ipfs.tech/reference/kubo/cli/#ipfs-add) used for merkleizing your content:
159159

160160
```yaml
161161
- name: Deploy to IPFS
@@ -170,7 +170,7 @@ You can also customize the Kubo version used for merkleizing your content:
170170

171171
To upload the CAR file to an IPFS Cluster:
172172

173-
1. Get your IPFS Cluster URL, username, and password
173+
1. Get your [IPFS Cluster CTL](https://ipfscluster.io/documentation/reference/ctl/) endpoint, username, and password
174174
2. Add them as GitHub secrets
175175
3. Add these lines to your workflow:
176176

@@ -191,17 +191,19 @@ You can also configure additional IPFS Cluster options:
191191
uses: ipfs/ipfs-deploy-action@v1
192192
with:
193193
# ... other inputs ...
194-
cluster-retry-attempts: '3' # Default number of retry attempts
195-
cluster-timeout-minutes: '5' # Default timeout in minutes per attempt
194+
cluster-retry-attempts: '5' # Override number of retry attempts
195+
cluster-timeout-minutes: '15' # Override timeout in minutes per attempt
196196
ipfs-cluster-ctl-version: 'v1.1.2' # Default version
197197
cluster-pin-expire-in: '720h' # Optional: Set pin to expire after time period (e.g., 30 days)
198198
```
199199

200-
This works by sending a request to the Pinning API with the CID of the deployment, and Pinata handles pinning in the background.
200+
### Pinning with Pinata
201+
202+
This works by sending a request to the [Pinning API](https://docs.pinata.cloud/api-reference/pinning-service-api) with the CID of the deployment, and Pinata handles pinning in the background.
201203

202204
To pin your content to Pinata:
203205

204-
1. Get your Pinata JWT token from the Pinata dashboard
206+
1. Get your [Pinata JWT token](https://docs.pinata.cloud/api-reference/pinning-service-api#authentication) from the Pinata dashboard
205207
2. Add it as a GitHub secret named `PINATA_JWT`
206208
3. Add these lines to your workflow:
207209

@@ -215,10 +217,10 @@ To pin your content to Pinata:
215217
```
216218

217219
### Adding Filebase Storage
218-
220+
Note that Filebase only supports static websites for paid accounts.
219221
To store CAR files on Filebase:
220222

221-
1. Create a Filebase account and bucket
223+
1. [Create a Filebase account](https://docs.filebase.com/archive/content-archive/ipfs-getting-started-guide#signing-up-for-filebase) and [bucket](https://docs.filebase.com/archive/content-archive/ipfs-getting-started-guide#how-to-create-an-ipfs-bucket)
222224
2. Get your access and secret keys
223225
3. Add them as GitHub secrets
224226
4. Add these lines to your workflow:
@@ -249,7 +251,7 @@ For example, here's where you can find the CID for a [given commit on GitHub]():
249251
You can load the app using the CID from the commit status, and it will be accessible through:
250252

251253
- [Public Good Gateway](../../concepts/public-utilities.md#public-ipfs-gateways): `https://<CID>.ipfs.dweb.link`
252-
- [Service Worker Gateway](https://inbrowser.link): `https://inbrowser.link/ipfs/<CID>`
254+
- [Service Worker Gateway](https://inbrowser.link): `https://<CID>.ipfs.inbrowser.link`
253255
- [Storacha Gateway](https://docs.storacha.network/concepts/ipfs-gateways/) (if using Storacha): `https://<CID>.ipfs.w3s.link`.
254256

255257
### With IPFS Desktop or Kubo

0 commit comments

Comments
 (0)