v1.0
Some checks failed
build-and-upload-docker / build-and-upload (push) Has been cancelled

This commit is contained in:
rebecca 2025-11-04 11:53:20 -03:00
commit 7f02ea62b3
3 changed files with 51 additions and 0 deletions

View File

@ -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

2
Dockerfile Normal file
View File

@ -0,0 +1,2 @@
FROM gitea/act_runner:latest
RUN apk add --no-cache nodejs npm

18
build-and-push.sh Executable file
View File

@ -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}"