From f1219e5a6f535481041af0e5efec28084df8d1cc Mon Sep 17 00:00:00 2001 From: Stanislaw <62724833+BoberITman@users.noreply.github.com> Date: Mon, 20 Jun 2022 21:40:20 +0200 Subject: [PATCH] auto deploy nienawidze gractwa --- .github/workflows/deploy.yaml | 10 +++++++--- Dockerfile | 5 +++-- pages/login.js | 0 3 files changed, 10 insertions(+), 5 deletions(-) delete mode 100644 pages/login.js diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 7e25286..c726f53 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -11,7 +11,11 @@ jobs: build: runs-on: self-hosted steps: - - name: Deploy + - uses: actions/checkout@v3 + - name: Build image + run: docker build -t ${{ github.repository }} . + - name: Deploy image run: | - npm install - npm run build + docker stop ${{ github.event.repository.name }} || true + docker rm ${{ github.event.repository.name }} || true + docker run -d -e ${{ github.repository }} -p 3000:3000 diff --git a/Dockerfile b/Dockerfile index 100d900..b3d2317 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,6 @@ FROM node:16.10.0 WORKDIR /app COPY ./ ./ -RUN npm install -CMD ["npm", "run", "build"] \ No newline at end of file +CMD ["npm","install"] +CMD ["npx","next","build"] +CMD ["npx","next","start"] diff --git a/pages/login.js b/pages/login.js deleted file mode 100644 index e69de29..0000000