From 6b2fe73fec99e14fb64d23a78cc0cc3c2f58c801 Mon Sep 17 00:00:00 2001 From: Akis Date: Sat, 27 Aug 2022 19:38:41 +0300 Subject: [PATCH 1/7] docker --- .dockerignore | 1 + Dockerfile | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..b512c09 --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0affa1e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM node:16 AS build + +WORKDIR /app + +COPY package.json ./ +RUN npm install +COPY . ./ +RUN npm run build + +FROM nginx:1.23-alpine +COPY --from=build /app/build /usr/share/nginx/html +EXPOSE 80 \ No newline at end of file From e847534f03682285e3f6b791d421029b591f8459 Mon Sep 17 00:00:00 2001 From: Akis Date: Sat, 27 Aug 2022 19:46:06 +0300 Subject: [PATCH 2/7] fix dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 0affa1e..3f52ee8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,4 +9,4 @@ RUN npm run build FROM nginx:1.23-alpine COPY --from=build /app/build /usr/share/nginx/html -EXPOSE 80 \ No newline at end of file +EXPOSE 80 From 798be41d53001b23f8ce8e13995d09df65f0bcf5 Mon Sep 17 00:00:00 2001 From: Akis Date: Sat, 27 Aug 2022 20:19:39 +0300 Subject: [PATCH 3/7] remove woodpecker --- .woodpecker.yml | 44 -------------------------------------------- 1 file changed, 44 deletions(-) delete mode 100644 .woodpecker.yml diff --git a/.woodpecker.yml b/.woodpecker.yml deleted file mode 100644 index d21626d..0000000 --- a/.woodpecker.yml +++ /dev/null @@ -1,44 +0,0 @@ -pipeline: - build: - when: - event: [push, pull_request] - image: node:bullseye-slim - commands: - - npm install - - npm run build - - pwd - - mv build/ ../ - - rm -rf * - - mv ../build/* . - push: - when: - event: [push] - image: appleboy/drone-git-push - settings: - branch: build - remote: git@github.com:ProjectSegfault/website.git - force: true - commit: true - commit_message: Successfully built the page. - ssh_key: - from_secret: ssh_key_git - update: - when: - event: [push] - image: appleboy/drone-ssh - settings: - host: - - projectsegfau.lt - username: gitea - key: - from_secret: ssh_key - port: 6665 - command_timeout: 1m - script: - - cd /var/www/ - - rm -rf html - - git clone -b build https://github.com/ProjectSegfault/website.git html - - cd html - # I HATE GIT AND HOW THEY FORCE THIS - # todo: do the funny pull but find a way to accept the changes. -branches: main From e3f718475d162a0a281b11aee1aed5908c948e56 Mon Sep 17 00:00:00 2001 From: Midou36O <45198486+Midou36O@users.noreply.github.com> Date: Wed, 31 Aug 2022 07:47:48 +0100 Subject: [PATCH 4/7] Workflow attempt (@akisblack merge this to the docker branch). --- .github/workflows/main.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..99e2407 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,29 @@ +name: Docker + +on: + push: + branches: + - 'master' + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - + name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - + name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v3 + with: + push: true + tags: projectsegfault/website:latest From 9c0535d73037572bb5fa72622ebf4b4a776efb72 Mon Sep 17 00:00:00 2001 From: Midou36O Date: Wed, 31 Aug 2022 09:11:56 +0100 Subject: [PATCH 5/7] remove woodpecker :( --- .woodpecker.yml | 44 -------------------------------------------- 1 file changed, 44 deletions(-) delete mode 100644 .woodpecker.yml diff --git a/.woodpecker.yml b/.woodpecker.yml deleted file mode 100644 index 7da68c0..0000000 --- a/.woodpecker.yml +++ /dev/null @@ -1,44 +0,0 @@ -pipeline: - build: - when: - event: [push, pull_request] - image: node:current-bullseye-slim - commands: - - npm install - - npm run build - - pwd - - mv build/ ../ - - rm -rf * - - mv ../build/* . - push: - when: - event: [push] - image: appleboy/drone-git-push - settings: - branch: build - remote: git@github.com:ProjectSegfault/website.git - force: true - commit: true - commit_message: Successfully built the page. - ssh_key: - from_secret: ssh_key_git - update: - when: - event: [push] - image: appleboy/drone-ssh - settings: - host: - - projectsegfau.lt - username: gitea - key: - from_secret: ssh_key - port: 6665 - command_timeout: 1m - script: - - cd /var/www/ - - rm -rf html - - git clone -b build https://github.com/ProjectSegfault/website.git html - - cd html - # I HATE GIT AND HOW THEY FORCE THIS - # todo: do the funny pull but find a way to accept the changes. -branches: main From 316e66d0204eb5dad77cf40abaec3cb392586789 Mon Sep 17 00:00:00 2001 From: Midou36O Date: Wed, 31 Aug 2022 09:17:28 +0100 Subject: [PATCH 6/7] rename to docker --- .github/workflows/main.yml | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 99e2407..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Docker - -on: - push: - branches: - - 'master' - -jobs: - docker: - runs-on: ubuntu-latest - steps: - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Login to DockerHub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build and push - uses: docker/build-push-action@v3 - with: - push: true - tags: projectsegfault/website:latest From 3fff95e38c5ab47c71e44b66c2b0cf546a0948fd Mon Sep 17 00:00:00 2001 From: Midou36O Date: Wed, 31 Aug 2022 09:18:49 +0100 Subject: [PATCH 7/7] ffs git please have something to auto add files. --- .github/workflows/docker.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/docker.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..99e2407 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,29 @@ +name: Docker + +on: + push: + branches: + - 'master' + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - + name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - + name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v3 + with: + push: true + tags: projectsegfault/website:latest