Skip to content

Commit 69fb512

Browse files
committed
from v1 config
1 parent aab6558 commit 69fb512

31 files changed

+2910
-36215
lines changed

.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
dist
3+
.git

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
[*]
7+
indent_style = space
8+
indent_size = 2
9+
end_of_line = lf
10+
charset = utf-8
11+
trim_trailing_whitespace = true
12+
insert_final_newline = true
13+
14+
[Makefile]
15+
indent_style = tab
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Build and Deploy
2+
on:
3+
workflow_call:
4+
inputs:
5+
branch:
6+
required: true
7+
type: string
8+
tag:
9+
required: true
10+
type: string
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v5
17+
- uses: actions/setup-node@v4
18+
with:
19+
node-version: 24
20+
cache: npm
21+
- run: npm ci
22+
23+
deploy:
24+
needs: build
25+
runs-on: ubuntu-latest
26+
if: ${{ github.event_name == 'push' }}
27+
steps:
28+
- uses: actions/checkout@v5
29+
- uses: docker/setup-buildx-action@v3
30+
- name: Log in to GitHub Container Registry
31+
uses: docker/login-action@v3
32+
with:
33+
registry: ghcr.io
34+
username: ${{ github.actor }}
35+
password: ${{ secrets.GITHUB_TOKEN }}
36+
- name: Build and push
37+
uses: docker/build-push-action@v6
38+
with:
39+
context: .
40+
push: true
41+
file: Dockerfile.production
42+
cache-from: ghcr.io/${{ github.repository }}:${{ inputs.tag }}
43+
cache-to: type=inline
44+
tags: ghcr.io/${{ github.repository }}:${{ inputs.tag }}
45+

.github/workflows/main.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Main
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
call:
11+
uses: ./.github/workflows/build-and-deploy.yml
12+
with:
13+
branch: main
14+
tag: latest

.github/workflows/v2.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: V2
2+
on:
3+
push:
4+
branches: [ v2_bug_fixes ]
5+
pull_request:
6+
branches: [ v2_bug_fixes ]
7+
8+
jobs:
9+
call:
10+
uses: ./.github/workflows/build-and-deploy.yml
11+
with:
12+
branch: v2_bug_fixes
13+
tag: v2

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@
2121
npm-debug.log*
2222
yarn-debug.log*
2323
yarn-error.log*
24+
dist

.npmrc

Whitespace-only changes.

Dockerfile.production

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM node:24-alpine
2+
3+
WORKDIR /app
4+
5+
COPY package*.json ./
6+
7+
RUN npm ci
8+
9+
COPY . .
10+
11+
RUN npm run build
12+
13+
CMD ["npx", "vite", "preview"]

Makefile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
install:
2+
npm ci
3+
4+
start:
5+
npm run dev
6+
7+
build:
8+
npm run build
9+
10+
preview:
11+
npm run preview
12+
13+
test:
14+
npm run test
15+
16+
compose-production:
17+
docker compose -f docker-compose.production.yml down -v --remove-orphans
18+
docker compose -f docker-compose.production.yml build
19+
docker compose -f docker-compose.production.yml up --abort-on-container-exit

README.md

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,45 @@
1-
# Products-store-hexlet
1+
Small store for QA.
22

3-
## To start:
4-
### `npm start`
3+
## Prerequisites
54

6-
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
7-
### `npm run build`
5+
Make sure you have the following installed:
86

9-
Builds the app for production to the `build` folder.\
10-
It correctly bundles React in production mode and optimizes the build for the best performance.
7+
- Unix (Linux, Macos)
8+
- Node.js (>= 24.x)
9+
- npm
10+
- Make (build tool)
11+
- Git (version control system)
12+
- Docker (optional, for containerized environments)
13+
14+
## Installation
15+
16+
Install dependencies:
17+
18+
```bash
19+
make install
20+
```
21+
22+
## Usage
23+
24+
Start the development server:
25+
26+
```bash
27+
make start
28+
```
29+
Open your browser and navigate to `http://localhost:3000`.
30+
31+
## Contributing
32+
33+
Contributions are welcome! Please follow our [contribution guidelines](CONTRIBUTING.md).
34+
35+
## License
36+
37+
This project is licensed under the [MIT License](LICENSE).
38+
39+
---
40+
Happy coding!
41+
---
42+
43+
[![Hexlet Ltd. logo](https://raw.githubusercontent.com/Hexlet/assets/master/images/hexlet_logo128.png)](https://hexlet.io/?utm_source=github&utm_medium=referral&utm_campaign=hexlet-components&utm_content=products-store)
44+
45+
This repository is created and maintained by the team and the community of Hexlet, an educational project. [Read more about Hexlet](https://hexlet.io/?utm_source=github&utm_medium=referral&utm_campaign=hexlet-components&utm_content=products-store).

0 commit comments

Comments
 (0)