diff --git a/.github/workflows/build_test_react.yml b/.github/workflows/build_test_react.yml index 141822d..2305876 100644 --- a/.github/workflows/build_test_react.yml +++ b/.github/workflows/build_test_react.yml @@ -6,14 +6,11 @@ on: jobs: build_test: - runs-on: ubuntu-latest + name: Build and test + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 - with: - node-version: '16' - check-latest: true - cache: 'npm' - - run: npm install - - run: npm run build - - run: npm test + - name: Build Docker image + run: docker build --target=builder -t retropilot-client:builder . + - name: Run tests + run: docker run --rm --env CI=true retropilot-client:builder npm test diff --git a/Dockerfile b/Dockerfile index 4b23729..77df0f1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,7 @@ ENV API_URL $API_URL COPY . . RUN npm run build -FROM nginx:1.20-alpine AS server +FROM nginx:1.20-alpine COPY --from=builder /app/build /usr/share/nginx/html COPY nginx.conf /etc/nginx/conf.d/default.conf