From 9e3f9d9a7aa38a856b156db90323169f08064d0d Mon Sep 17 00:00:00 2001 From: Przemek Grondek Date: Thu, 14 Sep 2023 20:58:42 +0000 Subject: [PATCH] Add CI Co-authored-by: Przemek Grondek Co-committed-by: Przemek Grondek --- .woodpecker.yml | 19 +++++++++++++++++++ Dockerfile | 8 ++++++++ docker/nginx.conf | 9 +++++++++ next.config.js | 1 + 4 files changed, 37 insertions(+) create mode 100644 .woodpecker.yml create mode 100644 Dockerfile create mode 100644 docker/nginx.conf diff --git a/.woodpecker.yml b/.woodpecker.yml new file mode 100644 index 0000000..6c97e3c --- /dev/null +++ b/.woodpecker.yml @@ -0,0 +1,19 @@ +steps: + build-static: + image: "node:20" + commands: + - npm install + - npm run build + build-docker: + image: woodpeckerci/plugin-docker-buildx + secrets: + - docker_username + - docker_password + settings: + registry: docker.grondek.pl + repo: docker.grondek.pl/react-homepage + auto_tag: true + tags: latest + platforms: linux/arm64 + when: + event: tag diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..cb0e821 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM nginx:1.24.0-alpine + +ENV NODE_ENV production + +RUN rm -rf /usr/share/nginx/html/* + +COPY out /usr/share/nginx/html/ +COPY docker/nginx.conf /etc/nginx/conf.d/default.conf diff --git a/docker/nginx.conf b/docker/nginx.conf new file mode 100644 index 0000000..fd5aefe --- /dev/null +++ b/docker/nginx.conf @@ -0,0 +1,9 @@ +server { + listen 80; + + location / { + root /usr/share/nginx/html/; + include /etc/nginx/mime.types; + try_files $uri $uri/ /index.html; + } +} \ No newline at end of file diff --git a/next.config.js b/next.config.js index a843cbe..42c10fd 100644 --- a/next.config.js +++ b/next.config.js @@ -1,5 +1,6 @@ /** @type {import('next').NextConfig} */ const nextConfig = { + output: 'export', reactStrictMode: true, }