diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml new file mode 100644 index 0000000..87e3388 --- /dev/null +++ b/.github/workflows/cicd.yml @@ -0,0 +1,25 @@ +name: "[relec-website] Build, Release, Deploy" + +on: + workflow_dispatch: + push: + branches: + - "main" + - "preview" + +jobs: + hugo-build-release-deploy: + uses: chnm/.github/.github/workflows/hugo--build-release-deploy.yml@main + secrets: inherit + with: + container-registry: "ghcr.io" + container-image-name: "relec-website" + hugo-context-root: "." + hugo-devl-url: "http://dev.religiousecologies.org" + hugo-prod-url: "https://religiousecologies.org" + + build-artifact-name: "relec-website" + release-tag-name-type: "iso" + + website-devl-fqdn: "dev.religiousecologies.org" + website-prod-fqdn: "religiousecologies.org" diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f27652a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM klakegg/hugo:0.107.0-ext-alpine as build-stage + +ARG hugobuildargs +ENV HUGO_BUILD_ARGS $hugobuildargs + +RUN apk add npm + +WORKDIR /app +ADD . . + +RUN npm install -y +RUN hugo ${HUGO_BUILD_ARGS} + +FROM nginx:1.23-alpine + +COPY --from=build-stage /app/public/ /usr/share/nginx/html + diff --git a/Makefile b/Makefile index 85c8019..2384ab2 100644 --- a/Makefile +++ b/Makefile @@ -7,23 +7,9 @@ build : hugo --cleanDestinationDir --buildDrafts --buildFuture --baseURL https://dev.religiousecologies.org/ @echo "Website finished building." -deploy : build - @echo "\nDeploying the site to dev with rsync ..." - rsync --delete --itemize-changes --omit-dir-times \ - --checksum -avz --no-t --no-perms --exclude-from=rsync-excludes \ - public/ athena:/websites/relecodev/www/ | egrep -v '^\.' - @echo "Finished deploying the site to dev with rsync." - build-prod : @echo "\nBuilding the site with Hugo ..." hugo --cleanDestinationDir --minify @echo "Website finished building." -deploy-prod : build-prod - @echo "\nDeploying the site to production with rsync ..." - rsync --delete --itemize-changes --omit-dir-times \ - --checksum -avz --no-t --no-perms --exclude-from=rsync-excludes \ - public/ athena:/websites/religiousecologies.org/ | egrep -v '^\.' - @echo "Finished deploying the site to production with rsync." - .PHONY : preview build deploy diff --git a/config.yaml b/config.yaml index a9db521..ff3b154 100644 --- a/config.yaml +++ b/config.yaml @@ -15,3 +15,5 @@ markup: goldmark: renderer: unsafe: true + +timeout: "120s" diff --git a/rsync-excludes b/rsync-excludes deleted file mode 100644 index cea7b64..0000000 --- a/rsync-excludes +++ /dev/null @@ -1,3 +0,0 @@ -.htaccess -.htpasswd -.DS_Store