Skip to content

Commit 553dc9e

Browse files
authored
Merge pull request #220 from Evilazaro:feature/reusableCIWorkflow
Feature/reusableCIWorkflow
2 parents f4cf8a8 + b11a25a commit 553dc9e

File tree

4 files changed

+496
-424
lines changed

4 files changed

+496
-424
lines changed
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Bicep Standard CI
2+
description: |
3+
This action builds Bicep templates and uploads the artifacts.
4+
5+
inputs:
6+
branch_name:
7+
description: 'The name of the branch being built'
8+
required: true
9+
new_version:
10+
description: 'The version being built'
11+
required: true
12+
should_publish:
13+
description: 'Whether the build should be published'
14+
required: true
15+
16+
runs:
17+
using: composite
18+
19+
steps:
20+
- name: Update Packages
21+
shell: bash
22+
run: |
23+
echo "✅ Updating packages..."
24+
# Simulate package update
25+
sudo apt-get update
26+
echo "✅ Packages updated successfully"
27+
28+
- name: Build Accelerator Bicep
29+
shell: bash
30+
run: |
31+
echo "✅ Building Bicep templates..."
32+
mkdir -p ./artifacts
33+
34+
# Check if Azure CLI is available
35+
if command -v az &> /dev/null; then
36+
az bicep build --file ./infra/main.bicep --outdir ./artifacts
37+
echo "✅ Bicep build completed"
38+
else
39+
echo "⚠️ Azure CLI not available, creating placeholder artifacts"
40+
echo "Bicep build would be executed here" > ./artifacts/placeholder.txt
41+
fi
42+
43+
- name: Upload Artifacts
44+
uses: actions/upload-artifact@v4
45+
with:
46+
name: artifacts-${{ steps.calculate_next_version.outputs.new_version }}
47+
path: ./artifacts
48+
compression-level: 6
49+
overwrite: true
50+
if-no-files-found: warn
51+
retention-days: 7
52+
53+
- name: Artifact Summary
54+
shell: bash
55+
run: |
56+
branch_name="${{ inputs.branch_name }}"
57+
version="${{ inputs.new_version }}"
58+
should_publish="${{ inputs.should_publish }}"
59+
60+
echo "📦 Artifacts Summary:"
61+
echo " - Version: $version"
62+
echo " - Branch: $branch_name"
63+
echo " - Tag created: ✅"
64+
echo " - Artifacts uploaded: ✅"
65+
echo " - GitHub release will be published: $should_publish"
66+
67+
if [[ "$should_publish" == "false" ]]; then
68+
echo ""
69+
echo "ℹ️ This is a development build from a non-main branch."
70+
echo " Tag and artifacts are created for tracking, but no GitHub release is published."
71+
fi

0 commit comments

Comments
 (0)