From af6f6ee17d85c40dd17dcb49e202ef4245cfc4b0 Mon Sep 17 00:00:00 2001 From: Will Estes Date: Fri, 24 Jul 2026 07:35:45 -0400 Subject: [PATCH] Add README, sync workflow, and courses scaffold Captures the boilerplate shared by all existing -eec-courses repos (README + sync.yml), parameterized with __CLIENT__/__DOMAIN__ placeholders for use via Gitea's Generate Repo. --- .gitea/workflows/sync.yml | 26 +++++++++++++++++++++++++ README.md | 40 +++++++++++++++++++++++++++++++++++++-- courses/.gitkeep | 0 3 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 .gitea/workflows/sync.yml create mode 100644 courses/.gitkeep diff --git a/.gitea/workflows/sync.yml b/.gitea/workflows/sync.yml new file mode 100644 index 0000000..57e8f73 --- /dev/null +++ b/.gitea/workflows/sync.yml @@ -0,0 +1,26 @@ +name: Sync courses +on: + push: + branches: [master] + +jobs: + sync: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Package and sync + run: | + tar czf /tmp/courses.tar.gz courses + status=$(curl -s -o /tmp/sync-response.json -w '%{http_code}' \ + -X POST "http://eec-__CLIENT__:8080/admin/sync" \ + -H "Authorization: Bearer ${__CLIENT___EEC_SYNC_TOKEN}" \ + --data-binary @/tmp/courses.tar.gz) + cat /tmp/sync-response.json + echo + if [ "$status" -ge 300 ]; then + echo "sync failed with status $status" + exit 1 + fi + env: + __CLIENT___EEC_SYNC_TOKEN: ${{ secrets.__CLIENT___EEC_SYNC_TOKEN }} diff --git a/README.md b/README.md index 5f3daa1..a2f1d51 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,39 @@ -# eec-courses-template +# __CLIENT__-eec-courses -Template for per-client eec course repos (welcome/nurture/lead-magnet email courses synced to an eec instance) \ No newline at end of file +Course content for [eec](https://gitea.reground.org/will/eec), the self-paced +email course engine — this instance served at eec.__DOMAIN__. Push to +`master` and CI syncs `courses/` straight to production — there's no staging +step, so treat a push here the same as a push to `eec` itself. + +Full reference for course/step file format, `course.yml` fields, the +readiness step, drip-triggered courses, and sync guardrails lives in the +[`eec-courses`](https://gitea.reground.org/will/eec-courses) README — the +format is identical, only the target instance differs. + +## Layout + +``` +courses/ + / + course.yml + day-0.md + day-1.md + ... +``` + +## Deploying + +Push to `master` → `.gitea/workflows/sync.yml` tars up `courses/` and +`POST`s it to this domain's `eec-__CLIENT__` container over the internal +Docker network, authenticated with `__CLIENT___EEC_SYNC_TOKEN` (a Gitea +Actions secret shared with the `eec-__CLIENT__` Ansible role's copy). No +separate deploy step, no staging — a push here goes live immediately. + +--- + +**Generating a new client repo from this template:** + +1. Gitea → "Generate Repo" from this template repo's page, named `-eec-courses`. +2. Find/replace `__CLIENT__` → the client's slug (must match the `eec-` container name) and `__DOMAIN__` → the client's domain, in this README and in `.gitea/workflows/sync.yml`. +3. Add the `_EEC_SYNC_TOKEN` Actions secret to the new repo (Gitea does not carry secrets over from a template) — value must match the `eec-` Ansible role's copy. +4. Delete this "Generating a new client repo" section from the new repo's README once done. diff --git a/courses/.gitkeep b/courses/.gitkeep new file mode 100644 index 0000000..e69de29