From 198c60aa34aa9dabe7be91ab1ae0b043506746ef Mon Sep 17 00:00:00 2001 From: Space-Banane Date: Thu, 14 May 2026 17:19:36 +0200 Subject: [PATCH] Add Gitea container publish workflow --- .gitea/workflows/ci.yml | 67 +++++++++++++++++++++++++++++++++++++++++ README.md | 16 ++++++++++ 2 files changed, 83 insertions(+) create mode 100644 .gitea/workflows/ci.yml diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..66649fc --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,67 @@ +name: CI + +on: + pull_request: + push: + branches: + - main + tags: + - 'v*' + +env: + REGISTRY: gitea.reversed.dev + IMAGE_NAME: space/evil-wordle + +jobs: + test: + name: Lint and build app + runs-on: ubuntu-latest + + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Lint + run: npm run lint + + - name: Build app + run: npm run build + + - name: Validate compose file + run: docker compose config + + publish-image: + name: Publish container image + runs-on: ubuntu-latest + needs: test + if: ${{ github.event_name == 'push' }} + + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Log in to Gitea registry + run: echo "${{ secrets.REGISTRY_TOKEN }}" | docker login "$REGISTRY" -u "${{ secrets.REGISTRY_USERNAME }}" --password-stdin + + - name: Build image + run: | + SHORT_SHA="${GITHUB_SHA::12}" + docker build \ + --tag "$REGISTRY/$IMAGE_NAME:latest" \ + --tag "$REGISTRY/$IMAGE_NAME:$SHORT_SHA" \ + . + + - name: Push image + run: | + SHORT_SHA="${GITHUB_SHA::12}" + docker push "$REGISTRY/$IMAGE_NAME:latest" + docker push "$REGISTRY/$IMAGE_NAME:$SHORT_SHA" diff --git a/README.md b/README.md index e06d767..f263f23 100644 --- a/README.md +++ b/README.md @@ -30,4 +30,20 @@ docker compose up --build The compose service publishes the app on `0.0.0.0:6666`. +## CI Image Publishing + +Gitea Actions workflow: `.gitea/workflows/ci.yml` + +Required repository or organization secrets: + +- `REGISTRY_USERNAME`: Gitea username allowed to publish packages +- `REGISTRY_TOKEN`: Gitea personal access token with package read/write access + +On pushes to `main`, CI publishes: + +```bash +gitea.reversed.dev/space/evil-wordle:latest +gitea.reversed.dev/space/evil-wordle: +``` + The app is built with React, Tailwind CSS, and Vite. Progress, settings, and stats are stored in `localStorage`. Guess validation uses `word-list-json`; curated local word buckets in `src/data/words.ts` control target selection and provide the fallback pool.