Files
security-command.org/.gitea/workflows/images.yml
T
Overlord d58101287d
images / check (push) Successful in 29s
images / sandbox (push) Successful in 35s
images / spawner (push) Successful in 59s
images / backend (push) Successful in 22s
images / jobs (push) Successful in 12s
Update Gitea workflows to use REGISTRY_USER and REGISTRY_TOKEN for registry login, falling back to GITEA_TOKEN when secrets are unavailable.
2026-10-13 16:59:39 +02:00

92 lines
2.9 KiB
YAML

# Builds the images and pushes them to the registry of the organization.
# Uses the secrets REGISTRY_USER and REGISTRY_TOKEN (a token with package
# write access) when they exist, else the automatic token of the run.
name: images
on:
push:
branches: [develop, master]
tags: ['v*']
env:
REGISTRY: git.security-command.org/securitycommand
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
- run: corepack pnpm install --frozen-lockfile
- run: corepack pnpm typecheck
- run: corepack pnpm test
sandbox:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Log in to the registry
run: >
echo "${{ secrets.REGISTRY_TOKEN || secrets.GITEA_TOKEN }}"
| docker login "${REGISTRY%%/*}" -u "${{ secrets.REGISTRY_USER || gitea.actor }}" --password-stdin
- name: Build and push
run: |
image="$REGISTRY/homepage-sandbox"
docker build -t "$image:${{ gitea.sha }}" -t "$image:${{ gitea.ref_name }}" sandbox/
docker push --all-tags "$image"
spawner:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Log in to the registry
run: >
echo "${{ secrets.REGISTRY_TOKEN || secrets.GITEA_TOKEN }}"
| docker login "${REGISTRY%%/*}" -u "${{ secrets.REGISTRY_USER || gitea.actor }}" --password-stdin
- name: Build and push
run: |
image="$REGISTRY/homepage-spawner"
docker build -f apps/spawner/Dockerfile -t "$image:${{ gitea.sha }}" -t "$image:${{ gitea.ref_name }}" .
docker push --all-tags "$image"
backend:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Log in to the registry
run: >
echo "${{ secrets.REGISTRY_TOKEN || secrets.GITEA_TOKEN }}"
| docker login "${REGISTRY%%/*}" -u "${{ secrets.REGISTRY_USER || gitea.actor }}" --password-stdin
- name: Build and push
run: |
image="$REGISTRY/homepage-backend"
docker build -f apps/backend/Dockerfile --build-arg BUILD_SHA=${{ gitea.sha }} -t "$image:${{ gitea.sha }}" -t "$image:${{ gitea.ref_name }}" .
docker push --all-tags "$image"
jobs:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Log in to the registry
run: >
echo "${{ secrets.REGISTRY_TOKEN || secrets.GITEA_TOKEN }}"
| docker login "${REGISTRY%%/*}" -u "${{ secrets.REGISTRY_USER || gitea.actor }}" --password-stdin
- name: Build and push
run: |
image="$REGISTRY/homepage-jobs"
docker build -f apps/jobs/Dockerfile -t "$image:${{ gitea.sha }}" -t "$image:${{ gitea.ref_name }}" .
docker push --all-tags "$image"