diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy-test.yml similarity index 74% rename from .github/workflows/deploy.yml rename to .github/workflows/deploy-test.yml index 4446fa95..6678085a 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy-test.yml @@ -1,16 +1,16 @@ -name: deploy +name: Deploy Testing Environment -on: workflow_dispatch +on: push jobs: deploy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: wshihadeh/docker-deployment-action@v2 with: remote_docker_host: webstrom@server.strom.sk ssh_private_key: ${{ secrets.WEBSTROM_DEPLOY_SSH_PRIVATE_KEY }} ssh_public_key: ${{ secrets.WEBSTROM_DEPLOY_SSH_PUBLIC_KEY }} - stack_file_name: compose.yaml + stack_file_name: deployment/compose-test.yaml args: up --build --force-recreate --detach diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 177af80a..c48a9a92 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out branch code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Node.js with Yarn cache uses: actions/setup-node@v3 with: diff --git a/.vscode/settings.json b/.vscode/settings.json index 902d7b93..9a1b58f9 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,6 +2,9 @@ "editor.codeActionsOnSave": { "source.fixAll.eslint": "explicit" }, + "files.associations": { + "compose-*.yaml": "dockercompose" + }, "git.branchProtection": [ "master" ], diff --git a/compose.yaml b/compose.yaml deleted file mode 100644 index 9f8451e7..00000000 --- a/compose.yaml +++ /dev/null @@ -1,8 +0,0 @@ -version: "3" - -services: - frontend: - build: . - image: webstrom-frontend - network_mode: "host" - restart: always diff --git a/Dockerfile b/deployment/Dockerfile similarity index 73% rename from Dockerfile rename to deployment/Dockerfile index 94f00da7..940c2a21 100644 --- a/Dockerfile +++ b/deployment/Dockerfile @@ -1,8 +1,10 @@ FROM node:18 +ARG NEXT_PUBLIC_BE_PORT + WORKDIR /app -COPY . ./ +COPY . /app RUN yarn && yarn build diff --git a/deployment/compose-test.yaml b/deployment/compose-test.yaml new file mode 100644 index 00000000..f45d617a --- /dev/null +++ b/deployment/compose-test.yaml @@ -0,0 +1,18 @@ +version: "3" + +services: + webstrom-frontend: + build: + context: .. + args: + - NEXT_PUBLIC_BE_PORT=8920 + + image: webstrom-test-frontend + + environment: + - PORT=8921 + - NEXT_PUBLIC_BE_PORT=8920 + + network_mode: host + + restart: always