From d52f92f1fd976295607e8468e488e56eb2c6960c Mon Sep 17 00:00:00 2001 From: Xe Iaso Date: Sun, 12 Jan 2025 23:38:31 -0500 Subject: [PATCH] automate builds Signed-off-by: Xe Iaso --- .envrc | 1 - .gitea/workflows/deploy.yml | 26 ++++++++++++++++++++++++++ Dockerfile | 19 +++++++++++++------ src/build.sh | 2 +- 4 files changed, 40 insertions(+), 8 deletions(-) delete mode 100644 .envrc create mode 100644 .gitea/workflows/deploy.yml diff --git a/.envrc b/.envrc deleted file mode 100644 index be81fed..0000000 --- a/.envrc +++ /dev/null @@ -1 +0,0 @@ -eval "$(lorri direnv)" \ No newline at end of file diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..f38f259 --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,26 @@ +name: Gitea Actions CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + tests: + name: Build and deploy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: log into ghcr.io + uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 + with: + registry: git.xeserv.us + username: mimi + password: ${{ secrets.PUSH_TOKEN }} + - name: build image + run: | + docker build -t git.xeserv.us/tulpamancy/tulpanomicon . + - name: push image + run: | + docker push git.xeserv.us/tulpamancy/tulpanomicon \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index ba1a0a2..5202b3d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,13 @@ -FROM xena/alpine -RUN apk --no-cache add quickserv -ENV PORT 3000 -CMD quickserv -port $PORT -dir /book -COPY ./book /book -WORKDIR /book +FROM git.xeserv.us/saved/xena/pandoc AS pandoc +WORKDIR /tulpa/nomicon +COPY . . +RUN cd src && ./build.sh + +FROM peaceiris/mdbook AS mdbook +WORKDIR /tulpa/nomicon +COPY . . +RUN mdbook build + +FROM nginx:alpine +COPY --from=pandoc /tulpa/nomicon/book /usr/share/nginx/html +COPY --from=mdbook /tulpa/nomicon/book /usr/share/nginx/html diff --git a/src/build.sh b/src/build.sh index a477277..3a668e4 100755 --- a/src/build.sh +++ b/src/build.sh @@ -111,5 +111,5 @@ ebook-convert tulpanomicon.epub tulpanomicon.mobi mkdir -p ../book cp -vrf tulpanomicon.mobi ../book/ cp -vrf tulpanomicon.epub ../book/ -cp -vrf tulpanomicon.pdf ../book/ +cp -vrf tulpanomicon.pdf ../book