From d87cdd54f1f93e26ba351278fc95ed25e7ff032e Mon Sep 17 00:00:00 2001 From: Benjamin Howe Date: Sat, 13 Jul 2024 19:35:05 +0100 Subject: [PATCH] Added CYO instructions to README --- .github/workflows/deploy-cloudflare.yaml | 2 +- README.md | 25 +++++++++++++++++------- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/.github/workflows/deploy-cloudflare.yaml b/.github/workflows/deploy-cloudflare.yaml index cbbb7c8..9435990 100644 --- a/.github/workflows/deploy-cloudflare.yaml +++ b/.github/workflows/deploy-cloudflare.yaml @@ -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 diff --git a/README.md b/README.md index 3cd219d..734c2ee 100644 --- a/README.md +++ b/README.md @@ -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). @@ -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/)