Files
dj-spangebob/.gitea/workflows/build_container.yml
Patryk Koreń 30d0485da3
Some checks failed
Build and Push Docker Image / docker (push) Has been cancelled
ci11
2026-01-07 20:32:10 +01:00

47 lines
1.3 KiB
YAML

name: Build and Push Docker Image
on:
push:
tags:
- '*' # Trigger on any git tag
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Podman
run: |
export XDG_RUNTIME_DIR=/tmp/run-user
export HOME=/tmp/home
mkdir -p $XDG_RUNTIME_DIR $HOME
# Ensure Podman is installed
if ! command -v podman &> /dev/null; then
echo "Podman not found, installing..."
sudo apt-get update && sudo apt-get install -y podman
fi
podman info || true # info will fail if storage driver is overlay, ignore
- name: Log in to Docker registry
run: |
echo "${REGISTRY_PASSWORD}" | podman login ${GITEA_REGISTRY} \
--username ${REGISTRY_USERNAME} --password-stdin
env:
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build and push Docker image
run: |
IMAGE_TAG="Papryk/dj-spangebob:${{ gitea.ref_name }}"
echo "Building image $IMAGE_TAG"
podman build -t "$IMAGE_TAG" .
echo "Pushing image $IMAGE_TAG"
podman push "$IMAGE_TAG"
env:
TAG: ${{ gitea.ref_name }}