Skip to content

Commit

Permalink
Added CYO instructions to README
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminEHowe committed Jul 13, 2024
1 parent c060163 commit d87cdd5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-cloudflare.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ jobs:
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy site --project-name=11ty-links --branch=${{ steps.extract_branch.outputs.branch }} --commit-dirty=true
command: pages deploy site --project-name=${{ vars.CLOUDFLARE_PAGES_PROJECT_NAME }} --branch=${{ steps.extract_branch.outputs.branch }} --commit-dirty=true
25 changes: 18 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,24 @@ This repository contains a self-hosted [Linktree](https://linktr.ee/)-style webs
It is deployed to https://11ty-links.pages.dev/.
We deploy using GitHub Actions as opposed to the [native Cloudflare Pages git integration](https://developers.cloudflare.com/pages/get-started/git-integration/) so that the build settings are captured within the `git` repository, and so that we can use the same container images for local development.

To create your own version of this website:
- [ ] Create a new Cloudflare Pages project. Select the option to create using direct upload, but do not upload any files yet (we will upload files automatically using GitHub Actions).
- [ ] Navigate to the list of your Workers & Pages projects, and select the newly created project. Under settings, set the following environment variables:
- `RESEND_KEY`: an API key for [Resend](https://resend.com/).
- `EMAIL_FROM`: the email address that contact form submissions should be sent from (the sending domain will need to be [registered with and verified by Resend](https://resend.com/docs/dashboard/domains/introduction)).
- `EMAIL_TO`: the email address that contact form submissions should be sent to.
- [ ] Create a new GitHub repository [using this one as a template](https://github.com/new?template_name=11ty-links&template_owner=BenjaminEHowe).
- [ ] [Set GitHub Actions secrets and variables for this repository](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-a-repository):
- Secrets:
- `CLOUDFLARE_ACCOUNT_ID`: your [Cloudflare account ID](https://developers.cloudflare.com/fundamentals/setup/find-account-and-zone-ids/).
- `CLOUDFLARE_API_TOKEN`: a [Cloudflare API token](https://developers.cloudflare.com/fundamentals/api/get-started/create-token/) with permission `Account.Cloudflare Pages` (`Edit` level).
- Variables:
- `CLOUDFLARE_PAGES_PROJECT_NAME`: the name of the Cloudflare Pages project that you created earlier.
- [ ] Customise [the list of links](/11ty-src/_data/links.json) as appropriate.
- [ ] Customise [the text on the home page](/11ty-src/index.md) as appropriate.
- [ ] (optional) Customise [the CSS](/11ty-src/assets/css/bundle.css) to change the colours etc.
- [ ] (optional) Delete [the lipsum file](/11ty-src/lipsum.md).

## Local Development

The easiest way to develop locally is using [Docker Desktop](https://www.docker.com/products/docker-desktop/) (other container engines are available).
Expand All @@ -16,10 +34,3 @@ The easiest way to develop locally is using [Docker Desktop](https://www.docker.
- macOS & Linux (bash): `docker run -it --rm -v "$PWD":/app -w /app -p 127.0.0.1:8080:8080 node:20.15.1 sh -c "cd /app && npm install && npx @11ty/eleventy --serve"`

Once the development server is running, the website will be available at http://localhost:8080/.

## Cloudflare Pages environment variables

The contact form requires a few environemnt variables to be populated:
- `EMAIL_FROM` -- the email address that contact form submissions should be sent from
- `EMAIL_TO` -- the email address that contact form submissions should be sent to
- `RESEND_KEY` -- an API key for [Resend](https://resend.com/)

0 comments on commit d87cdd5

Please sign in to comment.