From dcb353bacb933b816a5b7abf17438eaa6ae1437f Mon Sep 17 00:00:00 2001 From: Przemek Grondek Date: Thu, 14 Sep 2023 21:41:32 +0200 Subject: [PATCH] CI WIP --- .woodpecker.yml | 13 ++++++++++--- Dockerfile | 8 ++++++++ docker/nginx.conf | 9 +++++++++ 3 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 Dockerfile create mode 100644 docker/nginx.conf diff --git a/.woodpecker.yml b/.woodpecker.yml index 5aeb55e..1a41b71 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -1,5 +1,12 @@ -pipeline: - build: +steps: + build-static: image: "node:20" commands: - - npm run build \ No newline at end of file + - npm run build + build-docker: + image: "docker:24.0.6-dind" + commands: +# - docker build -t docker.grondek.pl/react-homepage:0.1 . + - docker buildx build --platform linux/arm64,linux/amd64 --push -t docker.grondek.pl/react-homepage:0.1 . +# when: +# - branch: [ master, main ] 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