Files
Stardream 326101958a
Build and Push Docker Image / build (push) Successful in 32s
Initial release
2026-05-20 15:25:51 +10:00

37 lines
891 B
YAML

name: Build and Push Docker Image
on:
push:
branches:
- main
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Log in to Gitea Container Registry
run: |
echo "${{ secrets.CR_TOKEN }}" | \
docker login git.stdm.moe -u ${{ github.actor }} --password-stdin
- name: Build and push
run: |
IMAGE=git.stdm.moe/stardream/streamhall
REF="${{ github.ref }}"
if [[ "$REF" == refs/tags/* ]]; then
VERSION="${REF#refs/tags/}"
docker build -t "${IMAGE}:${VERSION}" -t "${IMAGE}:latest" .
docker push "${IMAGE}:${VERSION}"
docker push "${IMAGE}:latest"
else
docker build -t "${IMAGE}:latest" .
docker push "${IMAGE}:latest"
fi