Only REGISTRY_TOKEN is configured; the REGISTRY_USERNAME secret the login step read doesn't exist, so it logged in with an empty username.
72 lines
2.2 KiB
YAML
72 lines
2.2 KiB
YAML
# Builds the app, session manager and streamer images and pushes them to this
|
|
# Gitea instance's container registry, under the repository's owner.
|
|
#
|
|
# Needs a repository secret REGISTRY_TOKEN: an access token with package write
|
|
# access, belonging to the repository's owner.
|
|
name: Images
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
tags: ['v*.*.*']
|
|
workflow_dispatch:
|
|
|
|
# Jobs that run docker builds use dejima-privileged; anything else should use
|
|
# dejima-confined.
|
|
jobs:
|
|
build:
|
|
name: ${{ matrix.name }}
|
|
runs-on: dejima-privileged
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- name: app
|
|
image: dotcom-arcade
|
|
context: .
|
|
- name: session-manager
|
|
image: dotcom-arcade-session-manager
|
|
context: streaming/session-manager
|
|
- name: streamer
|
|
image: dotcom-arcade-streamer
|
|
context: streaming/streamer
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
# The registry lives on the same host as this Gitea instance
|
|
- name: Locate the registry
|
|
id: registry
|
|
run: |
|
|
host=${GITHUB_SERVER_URL#*://}
|
|
echo "host=${host%/}" >> "$GITHUB_OUTPUT"
|
|
echo "owner=${GITHUB_REPOSITORY_OWNER,,}" >> "$GITHUB_OUTPUT"
|
|
|
|
- uses: docker/setup-buildx-action@v3
|
|
|
|
- uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ steps.registry.outputs.host }}
|
|
username: ${{ github.repository_owner }}
|
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
|
|
|
- id: meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: ${{ steps.registry.outputs.host }}/${{ steps.registry.outputs.owner }}/${{ matrix.image }}
|
|
tags: |
|
|
type=semver,pattern={{version}}
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/v') }}
|
|
type=ref,event=branch
|
|
|
|
- uses: docker/build-push-action@v6
|
|
with:
|
|
context: ${{ matrix.context }}
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
platforms: linux/amd64
|
|
build-args: |
|
|
VERSION=${{ steps.meta.outputs.version }}
|
|
provenance: false
|