Add Gitea container publish workflow
Some checks failed
CI / Publish container image (push) Has been cancelled
CI / Lint and build app (push) Has started running

This commit is contained in:
Space-Banane
2026-05-14 17:19:36 +02:00
parent 3f5ffc74af
commit 198c60aa34
2 changed files with 83 additions and 0 deletions

67
.gitea/workflows/ci.yml Normal file
View File

@@ -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"

View File

@@ -30,4 +30,20 @@ docker compose up --build
The compose service publishes the app on `0.0.0.0:6666`. 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:<commit-sha>
```
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. 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.