All checks were successful
Publish Builder Image / build-and-push (push) Successful in 3m15s
25 lines
753 B
Bash
25 lines
753 B
Bash
#!/bin/sh
|
|
set -e # Exit immediately if a command fails
|
|
|
|
# 1. Login to Gitea Registry
|
|
# We use the environment variables passed from the workflow
|
|
echo "Logging in to $REGISTRY..."
|
|
buildah login -u "$USERNAME" -p "$PASSWORD" --tls-verify=false --storage-driver=vfs "$REGISTRY"
|
|
|
|
# 2. Build the Image
|
|
# We build both the specific SHA tag and the 'latest' tag
|
|
echo "Building image $IMAGE..."
|
|
buildah build \
|
|
--tls-verify=false \
|
|
--storage-driver=vfs \
|
|
-f Dockerfile \
|
|
-t "$REGISTRY/$IMAGE:$TAG" \
|
|
-t "$REGISTRY/$IMAGE:latest" \
|
|
.
|
|
|
|
# 3. Push the Images
|
|
echo "Pushing images..."
|
|
buildah push --tls-verify=false --storage-driver=vfs "$REGISTRY/$IMAGE:$TAG"
|
|
buildah push --tls-verify=false --storage-driver=vfs "$REGISTRY/$IMAGE:latest"
|
|
|
|
echo "Done!" |