File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212 required : true
1313 openshift_licenseplate :
1414 required : true
15+ workflow_dispatch : # Allows manual triggering of the workflow
16+ inputs :
17+ image :
18+ description : ' Image name to build'
19+ required : true
20+ type : string
1521permissions :
1622 contents : read # Needed for any potential checkout operations
1723 id-token : write # Needed for OIDC authentication with OpenShift
1824defaults :
1925 run :
2026 working-directory : ./
2127jobs :
22- install :
28+ build-image :
2329 if : github.repository_owner == 'bcgov'
2430 runs-on : ubuntu-latest
2531 steps :
2632 - name : Install oc # Install OpenShift CLI, which is required for building images. It is not included in the default GitHub Actions runner.
2733 uses : redhat-actions/openshift-tools-installer@v1
2834 with :
29- oc : latest
35+ oc : " 4"
36+
37+ - name : Verify oc installation
38+ run : |
39+ which oc
40+ oc version --client
3041
3142 - name : Authenticate and set context
3243 uses : redhat-actions/oc-login@v1
3748
3849 - name : Image build
3950 run : |
51+ echo "Starting build for image: ${{ inputs.image }}"
4052 oc start-build ${{ inputs.image }} --follow
53+
54+ # Verify the build completed successfully
55+ if [ $? -eq 0 ]; then
56+ echo "✅ Build completed successfully"
57+ else
58+ echo "❌ Build failed"
59+ exit 1
60+ fi
You can’t perform that action at this time.
0 commit comments