From ebc1541001f06634d7c3b5ee149363e76af3dca0 Mon Sep 17 00:00:00 2001 From: Przemek Grondek Date: Wed, 13 Sep 2023 23:55:50 +0200 Subject: [PATCH 01/12] WIP CI --- .woodpecker.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .woodpecker.yml diff --git a/.woodpecker.yml b/.woodpecker.yml new file mode 100644 index 0000000..f9f8d33 --- /dev/null +++ b/.woodpecker.yml @@ -0,0 +1,5 @@ +pipeline: + build: + image: "node:18" + commands: + - npm run build \ No newline at end of file -- 2.45.2 From d5114a80f30c4a7975e9f6f3215b91ed02aab5b2 Mon Sep 17 00:00:00 2001 From: Przemek Grondek Date: Wed, 13 Sep 2023 23:59:43 +0200 Subject: [PATCH 02/12] WIP CI Enable static export --- .woodpecker.yml | 2 +- next.config.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index f9f8d33..5aeb55e 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -1,5 +1,5 @@ pipeline: build: - image: "node:18" + image: "node:20" commands: - npm run build \ 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, } -- 2.45.2 From dcb353bacb933b816a5b7abf17438eaa6ae1437f Mon Sep 17 00:00:00 2001 From: Przemek Grondek Date: Thu, 14 Sep 2023 21:41:32 +0200 Subject: [PATCH 03/12] 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 -- 2.45.2 From 1b8fb881398fc2ce2fc8a4213277502602348b2a Mon Sep 17 00:00:00 2001 From: Przemek Grondek Date: Thu, 14 Sep 2023 21:48:24 +0200 Subject: [PATCH 04/12] CI WIP --- .woodpecker.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.woodpecker.yml b/.woodpecker.yml index 1a41b71..7b439cd 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -2,6 +2,7 @@ steps: build-static: image: "node:20" commands: + - npm install - npm run build build-docker: image: "docker:24.0.6-dind" -- 2.45.2 From a23d540ab07d046a9236272b78319c9cee25de7d Mon Sep 17 00:00:00 2001 From: Przemek Grondek Date: Thu, 14 Sep 2023 21:54:55 +0200 Subject: [PATCH 05/12] CI WIP --- .woodpecker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 7b439cd..bf8ec37 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -7,7 +7,7 @@ steps: 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 . + - 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 ] -- 2.45.2 From 3f6f86fb51e7a4d7be9ad7fb4240a85c13b3ca7c Mon Sep 17 00:00:00 2001 From: Przemek Grondek Date: Thu, 14 Sep 2023 21:57:53 +0200 Subject: [PATCH 06/12] CI WIP --- .woodpecker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index bf8ec37..57acaeb 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -5,7 +5,7 @@ steps: - npm install - npm run build build-docker: - image: "docker:24.0.6-dind" + image: "docker:24.0.6-dind-rootless" 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 . -- 2.45.2 From 7253f30d2c9531769ec875a142ccc90ec607047e Mon Sep 17 00:00:00 2001 From: Przemek Grondek Date: Thu, 14 Sep 2023 22:07:52 +0200 Subject: [PATCH 07/12] CI WIP --- .woodpecker.yml | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 57acaeb..e423106 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -5,9 +5,19 @@ steps: - npm install - npm run build build-docker: - image: "docker:24.0.6-dind-rootless" - 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 ] + image: plugins/docker + settings: + repo: docker.grondek.pl/react-homepage + tags: 0.1 +# build-docker: +# image: docker +## image: "docker:24.0.6-dind-rootless" +# 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 ] + +services: + docker: + image: "docker:24.0.6-dind-rootless" \ No newline at end of file -- 2.45.2 From 5a4ceddfdd22b2195cb89e98ea9275404beedc02 Mon Sep 17 00:00:00 2001 From: Przemek Grondek Date: Thu, 14 Sep 2023 22:12:37 +0200 Subject: [PATCH 08/12] CI WIP --- .woodpecker.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index e423106..cb14eee 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -9,6 +9,7 @@ steps: settings: repo: docker.grondek.pl/react-homepage tags: 0.1 + platform: linux/arm64 # build-docker: # image: docker ## image: "docker:24.0.6-dind-rootless" @@ -17,7 +18,3 @@ steps: ## - docker buildx build --platform linux/arm64,linux/amd64 --push -t docker.grondek.pl/react-homepage:0.1 . ## when: ## - branch: [ master, main ] - -services: - docker: - image: "docker:24.0.6-dind-rootless" \ No newline at end of file -- 2.45.2 From 33b5cb19cff2761782301c618abbbfc43e7242e1 Mon Sep 17 00:00:00 2001 From: Przemek Grondek Date: Thu, 14 Sep 2023 22:17:19 +0200 Subject: [PATCH 09/12] CI WIP --- .woodpecker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index cb14eee..c31cf70 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -5,11 +5,11 @@ steps: - npm install - npm run build build-docker: - image: plugins/docker + image: woodpeckerci/plugin-docker-buildx settings: repo: docker.grondek.pl/react-homepage tags: 0.1 - platform: linux/arm64 + platforms: linux/arm64 # build-docker: # image: docker ## image: "docker:24.0.6-dind-rootless" -- 2.45.2 From bf9e1965206efe8d7084d3826f60b398ccfda2ff Mon Sep 17 00:00:00 2001 From: Przemek Grondek Date: Thu, 14 Sep 2023 22:27:34 +0200 Subject: [PATCH 10/12] CI WIP --- .woodpecker.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.woodpecker.yml b/.woodpecker.yml index c31cf70..78a8954 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -6,7 +6,11 @@ steps: - 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 tags: 0.1 platforms: linux/arm64 -- 2.45.2 From 4dfe54c06506e6ff947eb8d90f16e73fcad5c191 Mon Sep 17 00:00:00 2001 From: Przemek Grondek Date: Thu, 14 Sep 2023 22:38:28 +0200 Subject: [PATCH 11/12] CI WIP --- .woodpecker.yml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 78a8954..142232b 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -12,13 +12,10 @@ steps: settings: registry: docker.grondek.pl repo: docker.grondek.pl/react-homepage - tags: 0.1 + auto_tag: true + tags: latest platforms: linux/arm64 -# build-docker: -# image: docker -## image: "docker:24.0.6-dind-rootless" -# 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 ] +# when: +# branch: +# - main +# - master -- 2.45.2 From 8d76631d0d0298cec1c4363e99fe46ebdf589228 Mon Sep 17 00:00:00 2001 From: Przemek Grondek Date: Thu, 14 Sep 2023 22:57:05 +0200 Subject: [PATCH 12/12] CI WIP --- .woodpecker.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 142232b..6c97e3c 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -15,7 +15,5 @@ steps: auto_tag: true tags: latest platforms: linux/arm64 -# when: -# branch: -# - main -# - master + when: + event: tag -- 2.45.2