Skip to content

Commit fa0c384

Browse files
committed
🐛(hub) fix mistake in docker user
Remove :-1000 after docker user in github workflows
1 parent 49871c4 commit fa0c384

2 files changed

Lines changed: 49 additions & 82 deletions

File tree

.github/workflows/docker-hub.yml

Lines changed: 30 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ on:
55
workflow_dispatch:
66
push:
77
branches:
8-
- 'main'
8+
- "main"
99
tags:
10-
- 'v*'
10+
- "v*"
1111
pull_request:
1212
branches:
13-
- 'main'
14-
- 'ci/trivy-fails'
13+
- "main"
14+
- "ci/trivy-fails"
1515

1616
env:
1717
DOCKER_USER: 1001:127
@@ -20,40 +20,34 @@ jobs:
2020
build-and-push-backend:
2121
runs-on: ubuntu-latest
2222
steps:
23-
-
24-
name: Checkout repository
23+
- name: Checkout repository
2524
uses: actions/checkout@v4
26-
-
27-
name: Docker meta
25+
- name: Docker meta
2826
id: meta
2927
uses: docker/metadata-action@v5
3028
with:
3129
images: lasuite/impress-backend
32-
-
33-
name: Login to DockerHub
30+
- name: Login to DockerHub
3431
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'preview')
3532
uses: docker/login-action@v3
3633
with:
3734
username: ${{ secrets.DOCKER_HUB_USER }}
3835
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
39-
-
40-
name: Run trivy scan
36+
- name: Run trivy scan
4137
uses: numerique-gouv/action-trivy-cache@main
4238
with:
43-
docker-build-args: '--target backend-production -f Dockerfile'
44-
docker-image-name: 'docker.io/lasuite/impress-backend:${{ github.sha }}'
45-
-
46-
name: Build and push
39+
docker-build-args: "--target backend-production -f Dockerfile"
40+
docker-image-name: "docker.io/lasuite/impress-backend:${{ github.sha }}"
41+
- name: Build and push
4742
uses: docker/build-push-action@v6
4843
with:
4944
context: .
5045
target: backend-production
51-
build-args: DOCKER_USER=${{ env.DOCKER_USER }}:-1000
46+
build-args: DOCKER_USER=${{ env.DOCKER_USER }}
5247
push: ${{ github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'preview') }}
5348
tags: ${{ steps.meta.outputs.tags }}
5449
labels: ${{ steps.meta.outputs.labels }}
55-
-
56-
name: Cleanup Docker after build
50+
- name: Cleanup Docker after build
5751
if: always()
5852
run: |
5953
docker system prune -af
@@ -62,43 +56,37 @@ jobs:
6256
build-and-push-frontend:
6357
runs-on: ubuntu-latest
6458
steps:
65-
-
66-
name: Checkout repository
59+
- name: Checkout repository
6760
uses: actions/checkout@v4
68-
-
69-
name: Docker meta
61+
- name: Docker meta
7062
id: meta
7163
uses: docker/metadata-action@v5
7264
with:
7365
images: lasuite/impress-frontend
74-
-
75-
name: Login to DockerHub
66+
- name: Login to DockerHub
7667
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'preview')
7768
uses: docker/login-action@v3
7869
with:
7970
username: ${{ secrets.DOCKER_HUB_USER }}
8071
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
81-
-
82-
name: Run trivy scan
72+
- name: Run trivy scan
8373
uses: numerique-gouv/action-trivy-cache@main
8474
with:
85-
docker-build-args: '-f src/frontend/Dockerfile --target frontend-production'
86-
docker-image-name: 'docker.io/lasuite/impress-frontend:${{ github.sha }}'
87-
-
88-
name: Build and push
75+
docker-build-args: "-f src/frontend/Dockerfile --target frontend-production"
76+
docker-image-name: "docker.io/lasuite/impress-frontend:${{ github.sha }}"
77+
- name: Build and push
8978
uses: docker/build-push-action@v6
9079
with:
9180
context: .
9281
file: ./src/frontend/Dockerfile
9382
target: frontend-production
9483
build-args: |
95-
DOCKER_USER=${{ env.DOCKER_USER }}:-1000
84+
DOCKER_USER=${{ env.DOCKER_USER }}
9685
PUBLISH_AS_MIT=false
9786
push: ${{ github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'preview') }}
9887
tags: ${{ steps.meta.outputs.tags }}
9988
labels: ${{ steps.meta.outputs.labels }}
100-
-
101-
name: Cleanup Docker after build
89+
- name: Cleanup Docker after build
10290
if: always()
10391
run: |
10492
docker system prune -af
@@ -107,27 +95,22 @@ jobs:
10795
build-and-push-y-provider:
10896
runs-on: ubuntu-latest
10997
steps:
110-
-
111-
name: Checkout repository
98+
- name: Checkout repository
11299
uses: actions/checkout@v4
113-
-
114-
name: Docker meta
100+
- name: Docker meta
115101
id: meta
116102
uses: docker/metadata-action@v5
117103
with:
118104
images: lasuite/impress-y-provider
119-
-
120-
name: Login to DockerHub
105+
- name: Login to DockerHub
121106
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'preview')
122107
run: echo "${{ secrets.DOCKER_HUB_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_HUB_USER }}" --password-stdin
123-
-
124-
name: Run trivy scan
108+
- name: Run trivy scan
125109
uses: numerique-gouv/action-trivy-cache@main
126110
with:
127-
docker-build-args: '-f src/frontend/servers/y-provider/Dockerfile --target y-provider'
128-
docker-image-name: 'docker.io/lasuite/impress-y-provider:${{ github.sha }}'
129-
-
130-
name: Build and push
111+
docker-build-args: "-f src/frontend/servers/y-provider/Dockerfile --target y-provider"
112+
docker-image-name: "docker.io/lasuite/impress-y-provider:${{ github.sha }}"
113+
- name: Build and push
131114
uses: docker/build-push-action@v6
132115
with:
133116
context: .
@@ -137,8 +120,7 @@ jobs:
137120
push: ${{ github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'preview') }}
138121
tags: ${{ steps.meta.outputs.tags }}
139122
labels: ${{ steps.meta.outputs.labels }}
140-
-
141-
name: Cleanup Docker after build
123+
- name: Cleanup Docker after build
142124
if: always()
143125
run: |
144126
docker system prune -af

.github/workflows/ghcr.yml

Lines changed: 19 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ on:
55
workflow_dispatch:
66
push:
77
branches:
8-
- 'main'
8+
- "main"
99
tags:
10-
- 'v*'
10+
- "v*"
1111

1212
env:
1313
DOCKER_USER: 1001:127
@@ -21,11 +21,9 @@ jobs:
2121
contents: read
2222
packages: write
2323
steps:
24-
-
25-
name: Checkout repository
24+
- name: Checkout repository
2625
uses: actions/checkout@v4
27-
-
28-
name: Docker meta
26+
- name: Docker meta
2927
id: meta
3028
uses: docker/metadata-action@v5
3129
with:
@@ -36,25 +34,22 @@ jobs:
3634
type=semver,pattern={{version}}
3735
type=semver,pattern={{major}}.{{minor}}
3836
type=sha
39-
-
40-
name: Login to GHCR
37+
- name: Login to GHCR
4138
uses: docker/login-action@v3
4239
with:
4340
registry: ${{ env.REGISTRY }}
4441
username: ${{ github.actor }}
4542
password: ${{ secrets.GITHUB_TOKEN }}
46-
-
47-
name: Build and push
43+
- name: Build and push
4844
uses: docker/build-push-action@v6
4945
with:
5046
context: .
5147
target: backend-production
52-
build-args: DOCKER_USER=${{ env.DOCKER_USER }}:-1000
48+
build-args: DOCKER_USER=${{ env.DOCKER_USER }}
5349
push: true
5450
tags: ${{ steps.meta.outputs.tags }}
5551
labels: ${{ steps.meta.outputs.labels }}
56-
-
57-
name: Cleanup Docker after build
52+
- name: Cleanup Docker after build
5853
if: always()
5954
run: |
6055
docker system prune -af
@@ -67,11 +62,9 @@ jobs:
6762
contents: read
6863
packages: write
6964
steps:
70-
-
71-
name: Checkout repository
65+
- name: Checkout repository
7266
uses: actions/checkout@v4
73-
-
74-
name: Docker meta
67+
- name: Docker meta
7568
id: meta
7669
uses: docker/metadata-action@v5
7770
with:
@@ -82,28 +75,25 @@ jobs:
8275
type=semver,pattern={{version}}
8376
type=semver,pattern={{major}}.{{minor}}
8477
type=sha
85-
-
86-
name: Login to GHCR
78+
- name: Login to GHCR
8779
uses: docker/login-action@v3
8880
with:
8981
registry: ${{ env.REGISTRY }}
9082
username: ${{ github.actor }}
9183
password: ${{ secrets.GITHUB_TOKEN }}
92-
-
93-
name: Build and push
84+
- name: Build and push
9485
uses: docker/build-push-action@v6
9586
with:
9687
context: .
9788
file: ./src/frontend/Dockerfile
9889
target: frontend-production
9990
build-args: |
100-
DOCKER_USER=${{ env.DOCKER_USER }}:-1000
91+
DOCKER_USER=${{ env.DOCKER_USER }}
10192
PUBLISH_AS_MIT=false
10293
push: true
10394
tags: ${{ steps.meta.outputs.tags }}
10495
labels: ${{ steps.meta.outputs.labels }}
105-
-
106-
name: Cleanup Docker after build
96+
- name: Cleanup Docker after build
10797
if: always()
10898
run: |
10999
docker system prune -af
@@ -116,11 +106,9 @@ jobs:
116106
contents: read
117107
packages: write
118108
steps:
119-
-
120-
name: Checkout repository
109+
- name: Checkout repository
121110
uses: actions/checkout@v4
122-
-
123-
name: Docker meta
111+
- name: Docker meta
124112
id: meta
125113
uses: docker/metadata-action@v5
126114
with:
@@ -131,15 +119,13 @@ jobs:
131119
type=semver,pattern={{version}}
132120
type=semver,pattern={{major}}.{{minor}}
133121
type=sha
134-
-
135-
name: Login to GHCR
122+
- name: Login to GHCR
136123
uses: docker/login-action@v3
137124
with:
138125
registry: ${{ env.REGISTRY }}
139126
username: ${{ github.actor }}
140127
password: ${{ secrets.GITHUB_TOKEN }}
141-
-
142-
name: Build and push
128+
- name: Build and push
143129
uses: docker/build-push-action@v6
144130
with:
145131
context: .
@@ -149,8 +135,7 @@ jobs:
149135
push: true
150136
tags: ${{ steps.meta.outputs.tags }}
151137
labels: ${{ steps.meta.outputs.labels }}
152-
-
153-
name: Cleanup Docker after build
138+
- name: Cleanup Docker after build
154139
if: always()
155140
run: |
156141
docker system prune -af

0 commit comments

Comments
 (0)