Skip to content

Commit d46571e

Browse files
committed
chore: resolve conflicts with dev
2 parents 99b8330 + 6c39173 commit d46571e

139 files changed

Lines changed: 3261 additions & 1025 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,7 @@ S3_BUCKET_NAME=''
4646
S3_ENDPOINT=''
4747
S3_REGION=''
4848
S3_ACCESS_KEY=''
49-
S3_SECRET_KEY=''
49+
S3_SECRET_KEY=''
50+
51+
IMAGOR_SECRET=''
52+
IMAGOR_URL=''

.github/ISSUE_TEMPLATE/feature_request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: '🚀 Feature Request'
1+
name: 'Feature Request'
22
description: 'Предложить новую идею или улучшение'
33
labels: ['enhancement']
44
body:

.github/labeler.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
core:
2+
- changed-files:
3+
- any-glob-to-any-file: 'src/**/*'
4+
- all-globs-to-all-files:
5+
- '!src/shared/entities/**/*'
6+
- '!src/**/*.spec.{ts,js}'
7+
8+
database:
9+
- changed-files:
10+
- any-glob-to-any-file:
11+
- 'src/shared/entities/**/*'
12+
- 'libs/database/**/*'
13+
- 'migrations/**/*'
14+
- 'drizzle.config.ts'
15+
16+
dependencies:
17+
- changed-files:
18+
- any-glob-to-any-file:
19+
- 'package.json'
20+
- 'pnpm-lock.yaml'
21+
- 'pnpm-workspace.yaml'
22+
23+
devops:
24+
- changed-files:
25+
- any-glob-to-any-file:
26+
- 'infra/**/*'
27+
- '.github/workflows/**/*'
28+
- 'Dockerfile*'
29+
- '.dockerignore'
30+
31+
testing:
32+
- changed-files:
33+
- any-glob-to-any-file:
34+
- 'test/**/*'
35+
- 'src/**/*.spec.{ts,js}'
36+
- 'k6/**/*'
37+
- 'vitest.config*'
38+
39+
libs:
40+
- changed-files:
41+
- any-glob-to-any-file: 'libs/**/*'
42+
- all-globs-to-all-files:
43+
- '!libs/database/**/*'
44+
45+
dx:
46+
- changed-files:
47+
- any-glob-to-any-file:
48+
- 'pnpm-workspace.yaml'
49+
- '.*'
50+
- '!package.json'
51+
52+
documentation:
53+
- changed-files:
54+
- any-glob-to-any-file:
55+
- '**/*.md'
56+
- 'LICENSE'

.github/workflows/build.yml

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,47 @@ name: Build and Push
22

33
on:
44
push:
5-
branches: [dev, main, feat/**]
5+
branches: [main, dev, 'feat/**', 'fix/**', 'refactor/**', 'chore/**']
6+
pull_request:
7+
branches: [main, dev]
8+
workflow_dispatch:
9+
inputs:
10+
force_push:
11+
description: 'Force push image to registry?'
12+
type: boolean
13+
default: false
14+
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
618

719
env:
20+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
821
REGISTRY: ghcr.io
922
IMAGE_NAME: ${{ github.repository }}
1023

1124
jobs:
1225
build-push:
1326
runs-on: ubuntu-latest
27+
env:
28+
IS_BASE_BRANCH: ${{ github.ref_name == 'main' || github.ref_name == 'dev' }}
29+
IS_PUSH: ${{ github.event_name == 'push' }}
30+
FORCE_PUSH: ${{ github.event.inputs.force_push == 'true' }}
31+
1432
permissions:
1533
contents: read
1634
packages: write
1735

1836
steps:
19-
- uses: actions/checkout@v4
37+
- name: Checkout repository
38+
uses: actions/checkout@v4
2039

2140
- name: Set up Docker Buildx
2241
uses: docker/setup-buildx-action@v3
2342

2443
- name: Log in to the Container registry
44+
if: ${{ (env.IS_PUSH == 'true' && env.IS_BASE_BRANCH == 'true') ||
45+
env.FORCE_PUSH == 'true' }}
2546
uses: docker/login-action@v3
2647
with:
2748
registry: ${{ env.REGISTRY }}
@@ -36,14 +57,16 @@ jobs:
3657
tags: |
3758
type=ref,event=branch
3859
type=sha,format=short
39-
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
60+
# latest вешаем только когда мерджим в main
61+
type=raw,value=latest,enable=${{ github.ref_name == 'main' }}
4062
4163
- name: Build and push Docker image
4264
uses: docker/build-push-action@v5
4365
with:
4466
context: .
4567
file: ./Dockerfile.prod
46-
push: true
68+
push: ${{ (env.IS_PUSH == 'true' && env.IS_BASE_BRANCH == 'true') ||
69+
env.FORCE_PUSH == 'true' }}
4770
tags: ${{ steps.meta.outputs.tags }}
4871
labels: ${{ steps.meta.outputs.labels }}
4972
cache-from: type=gha

.github/workflows/ci.yml

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,38 @@
11
name: CI
22

33
on:
4-
pull_request:
5-
branches: [dev, main, 'feat/**']
64
push:
7-
branches: [dev, main, 'feat/**']
5+
branches:
6+
- main
7+
- dev
8+
- 'feat/**'
9+
- 'fix/**'
10+
- 'refactor/**'
11+
- 'chore/**'
12+
- 'perf/**'
13+
- 'build/**'
14+
- 'ci/**'
15+
paths-ignore:
16+
- '**.md'
17+
- 'infra/**'
18+
- '.gitignore'
19+
- 'docker-compose.yml'
20+
21+
pull_request:
22+
branches:
23+
- main
24+
- dev
25+
paths-ignore:
26+
- '**.md'
27+
- 'infra/**'
28+
workflow_dispatch:
29+
30+
concurrency:
31+
group: ${{ github.workflow }}-${{ github.ref }}
32+
cancel-in-progress: true
33+
34+
env:
35+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
836

937
jobs:
1038
quality-check:
@@ -21,11 +49,11 @@ jobs:
2149
- name: Setup Node.js
2250
uses: actions/setup-node@v4
2351
with:
24-
node-version: 20
52+
node-version: 24
2553
cache: 'pnpm'
2654

2755
- name: Install dependencies
28-
run: pnpm install --frozen-lockfile
56+
run: pnpm install --frozen-lockfile --prefer-offline
2957

3058
- name: Run Lint
3159
run: pnpm run lint

.github/workflows/cleanup.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: 'Cleanup'
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * 0'
6+
workflow_dispatch:
7+
8+
permissions:
9+
actions: write
10+
contents: read
11+
12+
jobs:
13+
garbage-collector:
14+
name: 'Purge Storage'
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: 'Clean Actions Cache'
21+
shell: bash
22+
run: |
23+
echo "::group::Deleting Caches"
24+
gh cache delete --all --succeed-on-no-caches || echo "Caches already empty or cleared"
25+
echo "::endgroup::"
26+
env:
27+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
29+
- name: 'Clean Old Artifacts'
30+
shell: bash
31+
run: |
32+
echo "::group::Deleting Artifacts"
33+
artifacts=$(gh api repos/${{ github.repository }}/actions/artifacts --paginate -q '.artifacts[].id' || echo "")
34+
35+
if [ -n "$artifacts" ]; then
36+
for id in $artifacts; do
37+
gh api -X DELETE repos/${{ github.repository }}/actions/artifacts/$id || true
38+
done
39+
echo "Artifacts cleared."
40+
else
41+
echo "No artifacts found."
42+
fi
43+
echo "::endgroup::"
44+
env:
45+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/codeql.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,26 @@ name: 'CodeQL'
22

33
on:
44
push:
5-
branches: [main, dev, feat/**, chore/**, build/**]
5+
branches: [main, dev]
6+
paths-ignore:
7+
- '**.md'
8+
- 'infra/**'
9+
- 'migrations/**'
610
pull_request:
7-
branches: [main]
11+
branches: [main, dev]
12+
paths-ignore:
13+
- '**.md'
814
schedule:
915
- cron: '15 13 * * 5'
1016

17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.ref }}
19+
1120
jobs:
1221
analyze:
1322
name: Analyze
1423
runs-on: ubuntu-latest
24+
timeout-minutes: 360
1525
permissions:
1626
actions: read
1727
contents: read
@@ -25,9 +35,12 @@ jobs:
2535
uses: github/codeql-action/init@v3
2636
with:
2737
languages: javascript-typescript
38+
queries: security-extended
2839

2940
- name: Autobuild
3041
uses: github/codeql-action/autobuild@v3
3142

3243
- name: Perform CodeQL Analysis
3344
uses: github/codeql-action/analyze@v3
45+
with:
46+
category: '/language:javascript-typescript'

.github/workflows/labeler.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: 'Pull Request Labeler'
2+
3+
on:
4+
# Важно: target позволяет работать в PR из форков
5+
pull_request_target:
6+
types: [opened, synchronize]
7+
8+
jobs:
9+
label:
10+
permissions:
11+
contents: read
12+
pull-requests: write
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Ensure Labels Exist
16+
env:
17+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
run: |
19+
labels=(
20+
"database:5319e7:Database schema and migrations"
21+
"core:e99695:Main application logic"
22+
"testing:ff69b4:Unit and E2E tests"
23+
"devops:006b75:Infrastructure and CI/CD"
24+
"shared-libs:bfdadc:Shared libraries in libs/"
25+
"dx:eeeeee:Developer experience and configs"
26+
"documentation:0075ca:Documentation and markdown files"
27+
)
28+
29+
for label in "${labels[@]}"; do
30+
IFS=":" read -r name color desc <<< "$label"
31+
gh label create "$name" --color "$color" --description "$desc" --repo ${{ github.repository }} || true
32+
done
33+
34+
- name: Run Labeler
35+
uses: actions/labeler@v5
36+
with:
37+
configuration-path: .github/labeler.yml
38+
sync-labels: true

0 commit comments

Comments
 (0)