commit 7f02ea62b3ca8ddb321d1ed73c59fb57be93e6a5 Author: rebecca Date: Tue Nov 4 11:53:20 2025 -0300 v1.0 diff --git a/.gitea/workflows/build-and-push.yaml b/.gitea/workflows/build-and-push.yaml new file mode 100644 index 0000000..ce03de9 --- /dev/null +++ b/.gitea/workflows/build-and-push.yaml @@ -0,0 +1,31 @@ +name: build-and-upload-docker + +on: + push: + branches: + - trunk + paths: + - 'Dockerfile' + - 'rootfs/**' + - 'build.sh' + +jobs: + build-and-upload: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_TOKEN }} + + - name: Build and push + run: | + chmod +x ./build.sh + ./build.sh \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b30644f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,2 @@ +FROM gitea/act_runner:latest +RUN apk add --no-cache nodejs npm \ No newline at end of file diff --git a/build-and-push.sh b/build-and-push.sh new file mode 100755 index 0000000..481dbb5 --- /dev/null +++ b/build-and-push.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +set -euo pipefail + +IMAGE_NAME="rbvtopudding/gitea-act_runner" +TAG="${1:-latest}" +FULL_IMAGE_NAME="${IMAGE_NAME}:${TAG}" + +# Get the directory where the script is located +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +echo "Building Docker image: ${FULL_IMAGE_NAME}" +docker build -t "${FULL_IMAGE_NAME}" "${SCRIPT_DIR}" + +echo "Pushing Docker image to Docker Hub: ${FULL_IMAGE_NAME}" +docker push "${FULL_IMAGE_NAME}" + +echo "Successfully built and pushed ${FULL_IMAGE_NAME}"