Add .gitea/workflows/test.yml
Some checks failed
Build and Publish TVJ EPG Image / build (push) Failing after 20s

This commit is contained in:
2026-02-03 01:15:52 -05:00
parent 0f70b25475
commit 04f427d994

80
.gitea/workflows/test.yml Normal file
View File

@@ -0,0 +1,80 @@
name: Build and Publish TVJ EPG Image
on:
push:
branches: [ main ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
env:
GITEA_TOKEN: ${{ secrets.TEA_TOKEN }}
run: |
set -euo pipefail
rm -rf ./* ./.git || true
BASE="${GITHUB_SERVER_URL%/}"
REPO="${GITHUB_REPOSITORY}"
if [ -n "${GITEA_TOKEN:-}" ]; then
CLONE_URL="${BASE}/${REPO}.git"
CLONE_URL="$(echo "$CLONE_URL" | sed -E 's#^https://#https://oauth2:'"${GITEA_TOKEN}"'@#')"
git clone "$CLONE_URL" .
else
git clone "${BASE}/${REPO}.git" .
fi
git config --global --add safe.directory "$PWD"
- name: Read version
id: version
run: |
VERSION="$(cat VERSION | tr -d ' \n')"
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Docker login
env:
REGISTRY: ${{ vars.REGISTRY }} # e.g. loxthelion.com or loxthelion.com:5050
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
REGISTRY_TOKEN: ${{ secrets.TEA_TOKEN }}
run: |
echo "$REGISTRY_TOKEN" | docker login "$REGISTRY" \
-u "$REGISTRY_USER" \
--password-stdin
- name: Build image (multi-tag)
shell: bash
env:
REGISTRY: ${{ vars.REGISTRY }}
VERSION: ${{ steps.version.outputs.version }}
run: |
set -euo pipefail
SHORT_SHA="${GITHUB_SHA::7}"
FULL_IMAGE="$REGISTRY/david/tvj-epg"
docker build \
-f Containerfile \
-t "$FULL_IMAGE:latest" \
-t "$FULL_IMAGE:v$VERSION" \
-t "$FULL_IMAGE:sha-$SHORT_SHA" \
.
- name: Push all tags
shell: bash
env:
REGISTRY: ${{ vars.REGISTRY }}
VERSION: ${{ steps.version.outputs.version }}
run: |
set -euo pipefail
SHORT_SHA="${GITHUB_SHA::7}"
FULL_IMAGE="$REGISTRY/david/tvj-epg"
docker push "$FULL_IMAGE:latest"
docker push "$FULL_IMAGE:v$VERSION"
docker push "$FULL_IMAGE:sha-$SHORT_SHA"