commit 1558e213d2310911f7167fd8b42396effd9b129f Author: boxi Date: Thu Jan 1 22:12:48 2026 +0100 init docker build script diff --git a/.gitea/workflows/docker.yml b/.gitea/workflows/docker.yml new file mode 100644 index 0000000..c19e616 --- /dev/null +++ b/.gitea/workflows/docker.yml @@ -0,0 +1,42 @@ +name: Build and Push Docker Image + +on: + push: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Login to Registry + uses: docker/login-action@v2 + with: + registry: eiche:3000 + username: ${{ secrets.REGISTRY_USER }} + password: ${{ secrets.REGISTRY_PASSWORD }} + + - name: Build Docker Image + env: + REGESTRY: eiche:3000 + IMAGE: ${{ GITHUB_REPOSITORY }} + run: | + # Build the image with the commit hash tag + docker build -t ${REGISTRY}/${IMAGE}:${GITHUB_RUN_NUMBER} . + + # Tag the same image as "latest" + docker tag ${REGISTRY}/${IMAGE}:${GITHUB_RUN_NUMBER} ${REGISTRY}/${IMAGE}:latest + + - name: Push Docker Images + env: + REGESTRY: eiche:3000 + IMAGE: ${{ GITHUB_REPOSITORY }} + run: | + docker push ${REGISTRY}/${IMAGE}:${GITHUB_RUN_NUMBER} + docker push ${REGISTRY}/${IMAGE}:latest + + - name: Log out from registry + if: always() + run: docker logout eiche:3000 \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..528875f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM eclipse-temurin:17 +RUN curl -sL https://deb.nodesource.com/setup_16.x | bash - && \ + apt-get update && \ + apt -y install nodejs && \ + apt-get clean \ No newline at end of file