Skip to content

Commit 77a3317

Browse files
committed
(workflows) ensure we run docker builds on main only
1 parent 1790cfd commit 77a3317

File tree

3 files changed

+77
-70
lines changed

3 files changed

+77
-70
lines changed

.github/workflows/docker-publish.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
name: Build and Push Docker Image
1+
name: Build and Push Container Image
22

3-
on:
3+
"on":
44
workflow_call:
55
inputs:
66
registry:
@@ -47,7 +47,6 @@ jobs:
4747
images: ${{ inputs.registry }}/${{ github.repository }}-${{ inputs.image_name }}
4848
tags: |
4949
type=ref,event=branch
50-
type=ref,event=pr
5150
type=semver,pattern={{version}}
5251
type=semver,pattern={{major}}.{{minor}}
5352
- name: Build and push Docker image
@@ -71,11 +70,11 @@ jobs:
7170
package-name: messages-${{ inputs.image_name }}
7271
package-type: 'container'
7372
min-versions-to-keep: 0
74-
delete-only-untagged-versions: 'true'
73+
delete-only-untagged-versions: true
7574
- name: Container images retention
7675
uses: actions/delete-package-versions@v5
7776
with:
7877
package-name: messages-${{ inputs.image_name }}
7978
package-type: 'container'
8079
min-versions-to-keep: 30
81-
ignore-versions: '^latest|main|(\\d+\\.\\d+(\\.\\d+)?)$'
80+
ignore-versions: 'latest|main|(\\d+\\.\\d+(\\.\\d+)?)'
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Build and publish OCI images
2+
3+
"on":
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
10+
docker-publish-mta-in:
11+
uses: ./.github/workflows/docker-publish.yml
12+
permissions:
13+
contents: read
14+
packages: write
15+
attestations: write
16+
id-token: write
17+
secrets: inherit
18+
with:
19+
image_name: "mta-in"
20+
context: "src/mta-in"
21+
target: runtime-prod
22+
23+
docker-publish-mta-out:
24+
uses: ./.github/workflows/docker-publish.yml
25+
permissions:
26+
contents: read
27+
packages: write
28+
attestations: write
29+
id-token: write
30+
secrets: inherit
31+
with:
32+
image_name: "mta-out"
33+
context: "src/mta-out"
34+
target: runtime-prod
35+
36+
docker-publish-socks-proxy:
37+
uses: ./.github/workflows/docker-publish.yml
38+
permissions:
39+
contents: read
40+
packages: write
41+
attestations: write
42+
id-token: write
43+
secrets: inherit
44+
with:
45+
image_name: "socks-proxy"
46+
context: "src/socks-proxy"
47+
48+
docker-publish-frontend:
49+
uses: ./.github/workflows/docker-publish.yml
50+
permissions:
51+
contents: read
52+
packages: write
53+
attestations: write
54+
id-token: write
55+
secrets: inherit
56+
with:
57+
image_name: "frontend"
58+
context: "src/frontend"
59+
target: runtime-prod
60+
61+
docker-publish-backend:
62+
uses: ./.github/workflows/docker-publish.yml
63+
permissions:
64+
contents: read
65+
packages: write
66+
attestations: write
67+
id-token: write
68+
secrets: inherit
69+
with:
70+
image_name: "backend"
71+
context: "src/backend"
72+
target: runtime-prod

.github/workflows/messages.yml

Lines changed: 1 addition & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Lint and tests
22

3-
on:
3+
"on":
44
push:
55
branches:
66
- main
@@ -110,67 +110,3 @@ jobs:
110110
run: |
111111
git diff --quiet || \
112112
(echo "API changes detected. Please run 'make api-update' then commit the changes." && exit 1)
113-
114-
docker-publish-mta-in:
115-
uses: ./.github/workflows/docker-publish.yml
116-
permissions:
117-
contents: read
118-
packages: write
119-
attestations: write
120-
id-token: write
121-
secrets: inherit
122-
with:
123-
image_name: "mta-in"
124-
context: "src/mta-in"
125-
target: runtime-prod
126-
127-
docker-publish-mta-out:
128-
uses: ./.github/workflows/docker-publish.yml
129-
permissions:
130-
contents: read
131-
packages: write
132-
attestations: write
133-
id-token: write
134-
secrets: inherit
135-
with:
136-
image_name: "mta-out"
137-
context: "src/mta-out"
138-
target: runtime-prod
139-
140-
docker-publish-socks-proxy:
141-
uses: ./.github/workflows/docker-publish.yml
142-
permissions:
143-
contents: read
144-
packages: write
145-
attestations: write
146-
id-token: write
147-
secrets: inherit
148-
with:
149-
image_name: "socks-proxy"
150-
context: "src/socks-proxy"
151-
152-
docker-publish-frontend:
153-
uses: ./.github/workflows/docker-publish.yml
154-
permissions:
155-
contents: read
156-
packages: write
157-
attestations: write
158-
id-token: write
159-
secrets: inherit
160-
with:
161-
image_name: "frontend"
162-
context: "src/frontend"
163-
target: runtime-prod
164-
165-
docker-publish-backend:
166-
uses: ./.github/workflows/docker-publish.yml
167-
permissions:
168-
contents: read
169-
packages: write
170-
attestations: write
171-
id-token: write
172-
secrets: inherit
173-
with:
174-
image_name: "backend"
175-
context: "src/backend"
176-
target: runtime-prod

0 commit comments

Comments
 (0)