From f8cbce907dceb5259c3726408560fa04523f10aa Mon Sep 17 00:00:00 2001 From: Rafael Cenzano <32753063+RafaelCenzano@users.noreply.github.com> Date: Fri, 27 Sep 2024 16:51:37 -0400 Subject: [PATCH] update actions --- .github/workflows/docker-deploy.yml | 2 +- .github/workflows/docker-test.yml | 22 +++++++++++++++++++--- .github/workflows/eslint.yml | 10 +++++++++- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker-deploy.yml b/.github/workflows/docker-deploy.yml index 4d8c3c0b..90f503e8 100644 --- a/.github/workflows/docker-deploy.yml +++ b/.github/workflows/docker-deploy.yml @@ -27,7 +27,7 @@ jobs: run: | npm ci --legacy-peer-deps CI=false - REACT_APP_BACKEND_SERVER="http://labconnect.cs.rpi.edu:9000" + REACT_APP_BACKEND_SERVER="https://api.labconnect.cs.rpi.edu" npm run build # Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here. - name: Log in to the Container registry diff --git a/.github/workflows/docker-test.yml b/.github/workflows/docker-test.yml index 04452523..25e6bc5c 100644 --- a/.github/workflows/docker-test.yml +++ b/.github/workflows/docker-test.yml @@ -1,18 +1,34 @@ name: Docker Build Test -on: [pull_request] +on: + pull_request: + paths: + - "**.js" + - "**.jsx" + - "**.ts" + - "**.tsx" jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Build React App run: | npm ci --legacy-peer-deps CI=false - REACT_APP_BACKEND_SERVER="http://labconnect.cs.rpi.edu:9000" + REACT_APP_BACKEND_SERVER="https://api.labconnect.cs.rpi.edu" npm run build + - name: "Build Docker Image" run: | - docker build . + docker build -t labconnect-frontend . + + - name: "Run Docker Container" + run: | + docker run -d --name labconnect-frontend-container labconnect-frontend + sleep 60 + docker logs labconnect-frontend-container + docker stop labconnect-frontend-container + docker rm labconnect-frontend-container diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml index 1c715f86..d1dc50a3 100644 --- a/.github/workflows/eslint.yml +++ b/.github/workflows/eslint.yml @@ -1,6 +1,12 @@ name: Lint -on: [push, pull_request] +on: + pull_request: + paths: + - "**.js" + - "**.jsx" + - "**.ts" + - "**.tsx" jobs: eslint: @@ -10,8 +16,10 @@ jobs: - uses: actions/setup-node@v3 with: node-version: 22 + - name: Install dependencies run: npm ci --legacy-peer-deps + - name: Run EsLint uses: sibiraj-s/action-eslint@v3 with: