From 4f184b46055bfe6e0a07d7ff50dcf76d4b9c70e9 Mon Sep 17 00:00:00 2001 From: Nicolai Van der Storm Date: Mon, 9 Sep 2024 14:23:55 +0200 Subject: [PATCH] added pipeline --- .gitea/workflows/pipeline.yml | 50 +++++++++++++++++++++++++++++++++++ Dockerfile | 2 +- 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 .gitea/workflows/pipeline.yml diff --git a/.gitea/workflows/pipeline.yml b/.gitea/workflows/pipeline.yml new file mode 100644 index 0000000..704a0d2 --- /dev/null +++ b/.gitea/workflows/pipeline.yml @@ -0,0 +1,50 @@ +name: Build and Push Docker Image + +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + container: + image: catthehacker/ubuntu:act-latest + env: + DOCKER_ORG: de_geythoek + RUNNER_TOOL_CACHE: /toolcache + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + with: + config-inline: | + [registry."git.nvds.be"] + http = true + insecure = true + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + registry: https://git.nvds.be + username: ${{ gitea.repository_owner }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Get Meta + id: meta + run: | + echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}') >> $GITHUB_OUTPUT + echo REPO_VERSION=$(git describe --tags --always | sed 's/^v//') >> $GITHUB_OUTPUT + + - name: Build and push Docker image + uses: docker/build-push-action@v6 + with: + context: . + push: true + tags: | + git.nvds.be/${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}:${{ steps.meta.outputs.REPO_VERSION }} + git.nvds.be/${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}:latest diff --git a/Dockerfile b/Dockerfile index 2410181..3fdf431 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,7 @@ COPY . . RUN npx tailwindcss -i ./input.css -o ./style/output.css RUN cargo leptos build --release -vv -FROM rustlang/rust:nightly-alpine as runner +FROM rustlang/rust:nightly-alpine AS runner WORKDIR /app