Skip to content

Commit 2881ead

Browse files
committed
Revert to d8b8246
1 parent d8b8246 commit 2881ead

Some content is hidden

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

50 files changed

+934
-162
lines changed

.github/dependabot.yml

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,22 @@
11
version: 2
2+
registries:
3+
ghcr:
4+
type: docker-registry
5+
url: ghcr.io
6+
username: ${{secrets.GHCR_USERNAME}}
7+
password: ${{secrets.GHCR_TOKEN}}
8+
9+
dockerhub:
10+
type: docker-registry
11+
url: registry-1.docker.io
12+
username: ${{secrets.DOCKERHUB_USER}}
13+
password: ${{secrets.DOCKERHUB_TOKEN}}
14+
15+
github-maven:
16+
type: maven-repository
17+
url: https://maven.pkg.github.com/${{github.repository_owner}}/*
18+
username: ${{secrets.GHCR_USERNAME}}
19+
password: ${{secrets.GHCR_TOKEN}}
220
updates:
321
# Dependabot maven có thể chạy ở root của multi-module project
422
- package-ecosystem: "maven"
@@ -12,25 +30,16 @@ updates:
1230
labels: [ "dependencies", "maven", "backend" ]
1331
groups:
1432
spring-bom:
15-
patterns:
16-
- "org.springframework.boot:*"
17-
- "org.springframework.cloud:*"
33+
patterns: [ "org.springframework.boot:*", "org.springframework.cloud:*" ]
1834
update-types: [ "minor", "patch" ]
1935
grpc-protobuf:
20-
patterns:
21-
- "io.grpc:*"
22-
- "com.google.protobuf:*"
36+
patterns: [ "io.grpc:*", "com.google.protobuf:*" ]
2337
update-types: [ "minor", "patch" ]
2438
mapping-and-utils:
25-
patterns:
26-
- "org.projectlombok:*"
27-
- "org.mapstruct:*"
39+
patterns: [ "org.projectlombok:*", "org.mapstruct:*" ]
2840
update-types: [ "minor", "patch" ]
2941
test-stack:
30-
patterns:
31-
- "org.jacoco:*"
32-
- "org.sonarsource.scanner.maven:sonar-maven-plugin"
33-
- "org.apache.maven.plugins:*"
42+
patterns: [ "org.jacoco:*", "org.sonarsource.scanner.maven:sonar-maven-plugin", "org.apache.maven.plugins:*" ]
3443
update-types: [ "minor", "patch" ]
3544

3645
# ========= FileService (.NET / NuGet) =========
@@ -57,19 +66,11 @@ updates:
5766
labels: [ "dependencies", "docker" ]
5867
open-pull-requests-limit: 10
5968
groups:
60-
nginx-node-base:
61-
patterns:
62-
- "nginx"
63-
- "node"
64-
update-types: [ "minor", "patch" ]
6569
dotnet-base:
66-
patterns:
67-
- "mcr.microsoft.com/dotnet/*"
70+
patterns: [ "mcr.microsoft.com/dotnet/*" ]
6871
update-types: [ "minor", "patch" ]
6972
jre-maven:
70-
patterns:
71-
- "eclipse-temurin:*"
72-
- "maven:*"
73+
patterns: [ "eclipse-temurin:*", "maven:*" ]
7374
update-types: [ "minor", "patch" ]
7475

7576
# ========= Dockerfiles ở root =========
@@ -87,6 +88,7 @@ updates:
8788
# ========= GitHub Actions =========
8889
- package-ecosystem: "github-actions"
8990
directory: "/"
91+
registries: [ "ghcr", "dockerhub" ]
9092
schedule:
9193
interval: "weekly"
9294
day: "monday"

.github/workflows/ci-sonar.yml

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,19 @@ jobs:
1515

1616
steps:
1717
- name: Checkout
18-
uses: actions/checkout@v4
18+
uses: actions/checkout@v5
1919
with:
2020
fetch-depth: 0 # Sonar cần có full history để tính "blame"
2121

2222
- name: Set up JDK 21
23-
uses: actions/setup-java@v4
23+
uses: actions/setup-java@v5
2424
with:
25-
distribution: 'temurin'
25+
distribution: temurin
2626
java-version: '21'
27-
cache: 'maven'
27+
cache: maven
28+
server-id: github
29+
settings-path: ${{ github.workspace }}
30+
token: ${{ secrets.GITHUB_TOKEN }}
2831

2932
- name: Build & Test
3033
run: mvn -B -DskipTests=false -Dmaven.test.failure.ignore=true verify
@@ -39,6 +42,25 @@ jobs:
3942
**/target/failsafe-reports/**
4043
if-no-files-found: ignore
4144

45+
- name: Set up JDK 21
46+
uses: actions/setup-java@v4
47+
with:
48+
distribution: 'temurin'
49+
java-version: '21'
50+
cache: maven
51+
server-id: 'github'
52+
server-username: 'GITHUB_ACTOR'
53+
server-password: '${{ secrets.GITHUB_TOKEN }}'
54+
settings-path: ${{ github.workspace }}
55+
56+
- name: Publish to GitHub Packages
57+
if: startsWith(github.ref, 'refs/tags/v')
58+
run: |
59+
# actions/setup-java (bên trên) đã tạo sẵn serverId=github dùng GITHUB_TOKEN
60+
mvn -B -DskipTests=true \
61+
-DaltDeploymentRepository=github::default::https://maven.pkg.github.com/${{ github.repository }} \
62+
deploy
63+
4264
- name: SonarQube / SonarCloud Scan
4365
env:
4466
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_BACKEND }}

.github/workflows/coding-service-publish.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626

2727
steps:
2828
- name: Checkout
29-
uses: actions/checkout@v4
29+
uses: actions/checkout@v5
3030

3131
- name: Set up QEMU (multi-arch)
3232
uses: docker/setup-qemu-action@v3
@@ -54,6 +54,7 @@ jobs:
5454
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
5555
IMAGE_TAG: ${{ env.IMAGE_TAG }}
5656
DOCKER_PLATFORMS: linux/amd64
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5758
run: |
5859
chmod +x ./build-image-coding-github.sh
5960
./build-image-coding-github.sh coding-service
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Dependabot Auto-merge (minor & patch)
2+
3+
on:
4+
pull_request_target:
5+
types: [ opened, synchronize, reopened, labeled ]
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
checks: read
11+
12+
jobs:
13+
auto-merge:
14+
if: github.actor == 'dependabot[bot]'
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Fetch metadata
18+
id: meta
19+
uses: dependabot/fetch-metadata@v2
20+
with:
21+
github-token: ${{ secrets.GITHUB_TOKEN }}
22+
23+
- name: Approve PR (minor/patch)
24+
if: |
25+
steps.meta.outputs.update-type == 'version-update:semver-minor' ||
26+
steps.meta.outputs.update-type == 'version-update:semver-patch'
27+
uses: peter-evans/approve-pull-request@v6
28+
with:
29+
pull-request-number: ${{ github.event.pull_request.number }}
30+
review-message: "Auto-approved by workflow for minor/patch updates."
31+
32+
- name: Enable auto-merge (squash)
33+
if: |
34+
steps.meta.outputs.update-type == 'version-update:semver-minor' ||
35+
steps.meta.outputs.update-type == 'version-update:semver-patch'
36+
uses: peter-evans/enable-pull-request-automerge@v3
37+
with:
38+
pull-request-number: ${{ github.event.pull_request.number }}
39+
merge-method: squash

.github/workflows/deploy.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
echo "run.head_sha: ${{ github.event.workflow_run.head_sha }}"
4343
4444
- name: Checkout
45-
uses: actions/checkout@v4
45+
uses: actions/checkout@v5
4646

4747
- name: Derive IMAGE_TAG (from workflow_run or manual)
4848
shell: bash
@@ -168,7 +168,7 @@ jobs:
168168
fi
169169
170170
- name: Ensure remote dir exists
171-
uses: appleboy/ssh-action@v1.0.3
171+
uses: appleboy/ssh-action@v1.2.2
172172
env:
173173
DEPLOY_DIR: ${{ steps.targetdir.outputs.DEPLOY_DIR_FINAL }}
174174
with:
@@ -195,7 +195,7 @@ jobs:
195195
test -d deploy_bundle/init/mongo
196196
197197
- name: Pre-clean monitoring paths on server
198-
uses: appleboy/ssh-action@v1.0.3
198+
uses: appleboy/ssh-action@v1.2.2
199199
with:
200200
host: ${{ secrets.SSH_HOST }}
201201
username: ${{ secrets.SSH_USER }}
@@ -216,7 +216,7 @@ jobs:
216216
done
217217
218218
- name: Upload bundle to server
219-
uses: appleboy/scp-action@v0.1.7
219+
uses: appleboy/scp-action@v1.0.0
220220
with:
221221
host: ${{ secrets.SSH_HOST }}
222222
username: ${{ secrets.SSH_USER }}
@@ -228,7 +228,7 @@ jobs:
228228
strip_components: 1
229229

230230
- name: Verify files exist on server (debug)
231-
uses: appleboy/ssh-action@v1.0.3
231+
uses: appleboy/ssh-action@v1.2.2
232232
with:
233233
host: ${{ secrets.SSH_HOST }}
234234
username: ${{ secrets.SSH_USER }}
@@ -238,7 +238,7 @@ jobs:
238238
ls -la '${{ steps.targetdir.outputs.DEPLOY_DIR_FINAL }}'
239239
240240
- name: Verify .env identical & run deploy
241-
uses: appleboy/ssh-action@v1.0.3
241+
uses: appleboy/ssh-action@v1.2.2
242242
env:
243243
IMAGE_TAG: ${{ env.IMAGE_TAG }}
244244
ENV_SHA: ${{ env.ENV_SHA }}

.github/workflows/docker-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636

3737
steps:
3838
- name: Checkout
39-
uses: actions/checkout@v4
39+
uses: actions/checkout@v5
4040

4141
- name: Set up QEMU (multi-arch)
4242
uses: docker/setup-qemu-action@v3

.github/workflows/file-service-publish.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626

2727
steps:
2828
- name: Checkout
29-
uses: actions/checkout@v4
29+
uses: actions/checkout@v5
3030

3131
- name: Set up QEMU (multi-arch)
3232
uses: docker/setup-qemu-action@v3
@@ -54,6 +54,7 @@ jobs:
5454
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
5555
IMAGE_TAG: ${{ env.IMAGE_TAG }}
5656
DOCKER_PLATFORMS: linux/amd64
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5758
run: |
5859
chmod +x ./build-image-file.sh
5960
./build-image-file.sh

.idea/compiler.xml

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)