mirror of
https://github.com/iritmaximus/workh.git
synced 2026-10-12 19:13:33 +03:00
[CI] Change to use private registry
This commit is contained in:
@@ -5,7 +5,6 @@ data/
|
|||||||
data.json.bak
|
data.json.bak
|
||||||
*.tmp
|
*.tmp
|
||||||
.git
|
.git
|
||||||
k8s
|
|
||||||
timetrials
|
timetrials
|
||||||
Dockerfile
|
Dockerfile
|
||||||
.dockerignore
|
.dockerignore
|
||||||
|
|||||||
@@ -65,22 +65,19 @@ jobs:
|
|||||||
name: Docker image
|
name: Docker image
|
||||||
needs: [lint, unit, e2e]
|
needs: [lint, unit, e2e]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
packages: write
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v5
|
||||||
- uses: docker/setup-buildx-action@v3
|
- uses: docker/setup-buildx-action@v3
|
||||||
- uses: docker/login-action@v3
|
- uses: docker/login-action@v3
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request'
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: registry.pumppi.dev
|
||||||
username: ${{ github.actor }}
|
username: ${{ secrets.REGISTRY_USER }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
- id: meta
|
- id: meta
|
||||||
uses: docker/metadata-action@v5
|
uses: docker/metadata-action@v5
|
||||||
with:
|
with:
|
||||||
images: ghcr.io/${{ github.repository }}
|
images: registry.pumppi.dev/workh
|
||||||
tags: |
|
tags: |
|
||||||
type=ref,event=branch
|
type=ref,event=branch
|
||||||
type=ref,event=pr
|
type=ref,event=pr
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ and keep a running balance of extra/minus hours.
|
|||||||
| `shared/` | Types used by both |
|
| `shared/` | Types used by both |
|
||||||
| `tests/` | Unit and integration tests (Vitest) |
|
| `tests/` | Unit and integration tests (Vitest) |
|
||||||
| `e2e/` | End-to-end tests (Playwright) |
|
| `e2e/` | End-to-end tests (Playwright) |
|
||||||
| `k8s/` | Kubernetes manifests |
|
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
@@ -65,10 +64,9 @@ npm run test:e2e # builds, starts two test servers, runs Playwright
|
|||||||
|
|
||||||
`.github/workflows/ci.yml` runs lint, format, type, unit and e2e checks on every push and
|
`.github/workflows/ci.yml` runs lint, format, type, unit and e2e checks on every push and
|
||||||
pull request. When they pass it builds the Docker image; pushes to `main` and `v*` tags
|
pull request. When they pass it builds the Docker image; pushes to `main` and `v*` tags
|
||||||
also publish it to `ghcr.io/<owner>/<repo>` (tags: `latest`, branch, version, commit SHA).
|
also publish it to `registry.pumppi.dev/workh` (tags: `latest`, branch, version, commit SHA).
|
||||||
|
|
||||||
GitHub packages are private by default: make the package public, or give the cluster an
|
Pushing needs the registry login in the `REGISTRY_USER` and `REGISTRY_PASSWORD` repository secrets.
|
||||||
image pull secret for ghcr.io.
|
|
||||||
|
|
||||||
## Docker
|
## Docker
|
||||||
|
|
||||||
@@ -80,17 +78,17 @@ docker run -p 3001:3001 --env-file .env.docker -v workh-data:/app/data workh #
|
|||||||
|
|
||||||
## Kubernetes
|
## Kubernetes
|
||||||
|
|
||||||
Manifests are in `k8s/`: Deployment (1 replica, PVC-backed), Service, and a Traefik
|
Manifests are in `workh/` of the [k8s-pumppi](../k8s-pumppi) repo: Deployment (1 replica,
|
||||||
Ingress at `workh.pumppi.dev` with the shared fail2ban middleware.
|
PVC-backed), Service, and a Traefik Ingress at `workh.pumppi.dev` with the shared fail2ban
|
||||||
|
middleware. Argo CD deploys them, and argocd-image-updater rolls out new `:latest` pushes.
|
||||||
|
|
||||||
1. Set `image:` in `k8s/deployment.yaml` to the image CI published.
|
1. Create the sealed secret (session secret, plus an optional invite code):
|
||||||
2. Create the sealed secret (session secret, plus an optional invite code):
|
|
||||||
```sh
|
```sh
|
||||||
npm run -s gen-secret > .env.secret
|
npm run -s gen-secret > .env.secret
|
||||||
echo "REGISTRATION_CODE=<invite code>" >> .env.secret # optional
|
echo "REGISTRATION_CODE=<invite code>" >> .env.secret # optional
|
||||||
kubectl create secret generic workh-secrets -n default \
|
kubectl create secret generic workh-secrets -n default \
|
||||||
--from-env-file=.env.secret --dry-run=client -o yaml \
|
--from-env-file=.env.secret --dry-run=client -o yaml \
|
||||||
| kubeseal --format yaml > k8s/sealed-secret.yaml
|
| kubeseal --format yaml > ../k8s-pumppi/workh/sealed-secret.yaml
|
||||||
rm .env.secret
|
rm .env.secret
|
||||||
```
|
```
|
||||||
3. Apply: `kubectl apply -f k8s/`
|
2. Commit and push k8s-pumppi; Argo CD applies it.
|
||||||
|
|||||||
Reference in New Issue
Block a user