Skip to content

Commit 0a82197

Browse files
committed
ci: docker build is now done with a shared workflow
This will allow us to run the workflow in PRs.
1 parent a30eae0 commit 0a82197

File tree

2 files changed

+35
-10
lines changed

2 files changed

+35
-10
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Build docker image
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
push:
7+
description: Indicates if the docker image has to be pushed
8+
type: boolean
9+
default: false
10+
outputs:
11+
image-tag:
12+
description: Image tag used
13+
value: ${{ github.event.pull_request.head.sha || github.sha }}
14+
15+
defaults:
16+
run:
17+
shell: bash
18+
19+
jobs:
20+
build:
21+
name: Docker Build 🐋
22+
runs-on: x1-core
23+
permissions:
24+
id-token: write
25+
contents: read
26+
packages: write
27+
steps:
28+
- name: Docker build
29+
uses: cloudbeds/composite-actions/docker/build-push/remote@v2
30+
with:
31+
push: ${{ inputs.push }}

.github/workflows/merge-main.yaml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,7 @@ on:
1010
jobs:
1111
build-push:
1212
name: Build and push application image
13-
runs-on: x1-core
14-
permissions:
15-
id-token: write
16-
contents: read
17-
steps:
18-
19-
- name: Build and push application image
20-
uses: cloudbeds/composite-actions/docker/build-push/remote@v2
21-
with:
22-
push: true
13+
uses: ./.github/workflows/docker-build.yaml
14+
secrets: inherit
15+
with:
16+
push: true

0 commit comments

Comments
 (0)