-
Notifications
You must be signed in to change notification settings - Fork 373
Expand file tree
/
Copy pathaction.yml
More file actions
39 lines (35 loc) · 1.16 KB
/
action.yml
File metadata and controls
39 lines (35 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Build Docker Image
description: 'Builds a Docker image for the application'
inputs:
app_name:
description: 'Name of the application'
required: true
org:
description: 'Organization name'
required: true
commit:
description: 'Commit SHA to tag the image with'
required: true
PR_NUMBER:
description: 'PR number'
required: false
runs:
using: "composite"
steps:
- name: Build Docker Image
id: build
shell: bash
run: |
PR_INFO=""
if [ -n "${PR_NUMBER}" ]; then
PR_INFO=" for PR #${PR_NUMBER}"
fi
echo "🏗️ Building Docker image${PR_INFO} (commit ${{ inputs.commit }})..."
if cpflow build-image -a "${{ inputs.app_name }}" --commit="${{ inputs.commit }}" --org="${{ inputs.org }}"; then
image_tag="${{ inputs.org }}/${{ inputs.app_name }}:${{ inputs.commit }}"
echo "image_tag=${image_tag}" >> $GITHUB_OUTPUT
echo "✅ Docker image build successful${PR_INFO} (commit ${{ inputs.commit }})"
else
echo "❌ Docker image build failed${PR_INFO} (commit ${{ inputs.commit }})"
exit 1
fi