From 7cfc751cc84743b8e2bba8c8d614966526dc83a9 Mon Sep 17 00:00:00 2001 From: Ahmed Abdelhalim Date: Thu, 10 Aug 2023 15:57:04 +0300 Subject: Update Readme and deploy hugo site --- .build.yml | 6 ++---- Dockerfile | 16 ++++------------ README.md | 15 +++++---------- docker-compose.yml | 2 +- 4 files changed, 12 insertions(+), 27 deletions(-) diff --git a/.build.yml b/.build.yml index c9d5c82..3d244bd 100644 --- a/.build.yml +++ b/.build.yml @@ -2,14 +2,12 @@ image: alpine/latest oauth: pages.sr.ht/PAGES:RW packages: - - yarn - - nodejs + - hugo tasks: - build: | cd a14m.srht.site - yarn install - yarn build + hugo tar -C public -cvz . > ../site.tar.gz - publish: | diff --git a/Dockerfile b/Dockerfile index 98c4f35..545dff8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,7 @@ -FROM node:18 as build +FROM alpine:3.18 as build +RUN apk add --no-cache hugo WORKDIR /app -COPY package.json yarn.lock . - -RUN yarn install --all COPY . . -RUN yarn build - - -FROM busybox:1.36 -RUN adduser -D static -WORKDIR /home/static -COPY --from=build /app/public . -CMD ["busybox", "httpd", "-f", "-v", "-p", "3333"] +RUN hugo +CMD ["hugo", "serve", "--bind", "0.0.0.0"] diff --git a/README.md b/README.md index e850d32..4962260 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,15 @@ # Local ## Prerequisites : -- Node v12 (or higher): `brew install node` -- Yarn: `brew install yarn` - -## Installation : -- Clone the repo. -- Run `yarn install` +- Hugo: `brew install hugo` ## Development : -- Run `yarn start` +- Run `hugo serve` ## Build : -- Run `yarn build` +- Run `hugo` ## Deploy : -- Run `yarn build` +- Run `hugo` - Copy the generated `public` directory to any hosting environment. (`srht.site`) # Docker @@ -23,7 +18,7 @@ ## Build - Run `docker build . -t website` -- Run `docker run -p 3333:3333 -it website` +- Run `docker run -p 1313:1313 -it website` or - Run `docker-compose build` - Run `docker-compose up` diff --git a/docker-compose.yml b/docker-compose.yml index ee233c5..404472b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,4 +9,4 @@ services: dockerfile: Dockerfile restart: always ports: - - "3333:3333" + - "1313:1313" -- cgit v1.2.3