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/.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 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 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3f52ee8 --- /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