Skip to content

Commit 1d3c10a

Browse files
authored
Merge pull request #5186 from cloudfoundry/angular20/experimental
Merging in Angular20/experimental to Develop to enable further collaboration on improvements
2 parents b9037bf + 998433b commit 1d3c10a

2,811 files changed

Lines changed: 153271 additions & 60046 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/docker.yml

Lines changed: 205 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
1+
name: Docker Build and Push
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Version tag (e.g., v5.0.0)'
8+
required: true
9+
type: string
10+
push:
11+
description: 'Push to registry'
12+
required: false
13+
type: boolean
14+
default: true
15+
release:
16+
types: [published]
17+
18+
env:
19+
REGISTRY: ghcr.io
20+
IMAGE_BASE: ghcr.io/${{ github.repository_owner }}/stratos
21+
22+
permissions:
23+
contents: read
24+
packages: write
25+
26+
jobs:
27+
build-matrix:
28+
name: Build Container Images
29+
runs-on: ubuntu-latest
30+
strategy:
31+
matrix:
32+
component: [ui, backend]
33+
platform: [linux/amd64, linux/arm64]
34+
steps:
35+
- name: Checkout code
36+
uses: actions/checkout@v4
37+
38+
- name: Get version
39+
id: version
40+
run: |
41+
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
42+
VERSION="${{ inputs.version }}"
43+
else
44+
VERSION="${{ github.event.release.tag_name }}"
45+
fi
46+
echo "version=${VERSION}" >> $GITHUB_OUTPUT
47+
echo "version_short=${VERSION#v}" >> $GITHUB_OUTPUT
48+
49+
- name: Set up QEMU
50+
uses: docker/setup-qemu-action@v3
51+
52+
- name: Set up Docker Buildx
53+
uses: docker/setup-buildx-action@v3
54+
55+
- name: Log in to GitHub Container Registry
56+
if: github.event_name != 'workflow_dispatch' || inputs.push
57+
uses: docker/login-action@v3
58+
with:
59+
registry: ${{ env.REGISTRY }}
60+
username: ${{ github.actor }}
61+
password: ${{ secrets.GITHUB_TOKEN }}
62+
63+
- name: Extract metadata for ${{ matrix.component }}
64+
id: meta
65+
uses: docker/metadata-action@v5
66+
with:
67+
images: ${{ env.IMAGE_BASE }}-${{ matrix.component }}
68+
tags: |
69+
type=semver,pattern={{version}},value=${{ steps.version.outputs.version }}
70+
type=semver,pattern={{major}}.{{minor}},value=${{ steps.version.outputs.version }}
71+
type=semver,pattern={{major}},value=${{ steps.version.outputs.version }}
72+
type=raw,value=latest,enable=${{ !contains(steps.version.outputs.version, '-') }}
73+
74+
- name: Build and push ${{ matrix.component }} (${{ matrix.platform }})
75+
uses: docker/build-push-action@v5
76+
with:
77+
context: .
78+
file: deploy/Dockerfile.${{ matrix.component == 'backend' && 'bk' || 'ui' }}
79+
platforms: ${{ matrix.platform }}
80+
push: ${{ github.event_name != 'workflow_dispatch' || inputs.push }}
81+
tags: ${{ steps.meta.outputs.tags }}
82+
labels: ${{ steps.meta.outputs.labels }}
83+
target: prod-build
84+
build-args: |
85+
stratos_version=${{ steps.version.outputs.version_short }}
86+
cache-from: type=gha
87+
cache-to: type=gha,mode=max
88+
89+
build-all-in-one:
90+
name: Build All-in-One Image
91+
runs-on: ubuntu-latest
92+
needs: build-matrix
93+
steps:
94+
- name: Checkout code
95+
uses: actions/checkout@v4
96+
97+
- name: Get version
98+
id: version
99+
run: |
100+
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
101+
VERSION="${{ inputs.version }}"
102+
else
103+
VERSION="${{ github.event.release.tag_name }}"
104+
fi
105+
echo "version=${VERSION}" >> $GITHUB_OUTPUT
106+
echo "version_short=${VERSION#v}" >> $GITHUB_OUTPUT
107+
108+
- name: Set up Docker Buildx
109+
uses: docker/setup-buildx-action@v3
110+
111+
- name: Log in to GitHub Container Registry
112+
if: github.event_name != 'workflow_dispatch' || inputs.push
113+
uses: docker/login-action@v3
114+
with:
115+
registry: ${{ env.REGISTRY }}
116+
username: ${{ github.actor }}
117+
password: ${{ secrets.GITHUB_TOKEN }}
118+
119+
- name: Check for all-in-one Dockerfile
120+
id: check-aio
121+
run: |
122+
if [ -f "deploy/all-in-one/Dockerfile" ]; then
123+
echo "exists=true" >> $GITHUB_OUTPUT
124+
else
125+
echo "exists=false" >> $GITHUB_OUTPUT
126+
echo "⚠️ All-in-one Dockerfile not found, skipping"
127+
fi
128+
129+
- name: Extract metadata
130+
if: steps.check-aio.outputs.exists == 'true'
131+
id: meta
132+
uses: docker/metadata-action@v5
133+
with:
134+
images: ${{ env.IMAGE_BASE }}
135+
tags: |
136+
type=semver,pattern={{version}},value=${{ steps.version.outputs.version }}
137+
type=semver,pattern={{major}}.{{minor}},value=${{ steps.version.outputs.version }}
138+
type=semver,pattern={{major}},value=${{ steps.version.outputs.version }}
139+
type=raw,value=latest,enable=${{ !contains(steps.version.outputs.version, '-') }}
140+
141+
- name: Build and push all-in-one
142+
if: steps.check-aio.outputs.exists == 'true'
143+
uses: docker/build-push-action@v5
144+
with:
145+
context: .
146+
file: deploy/all-in-one/Dockerfile
147+
platforms: linux/amd64,linux/arm64
148+
push: ${{ github.event_name != 'workflow_dispatch' || inputs.push }}
149+
tags: ${{ steps.meta.outputs.tags }}
150+
labels: ${{ steps.meta.outputs.labels }}
151+
build-args: |
152+
stratos_version=${{ steps.version.outputs.version_short }}
153+
cache-from: type=gha
154+
cache-to: type=gha,mode=max
155+
156+
verify-images:
157+
name: Verify Images
158+
runs-on: ubuntu-latest
159+
needs: [build-matrix, build-all-in-one]
160+
if: github.event_name != 'workflow_dispatch' || inputs.push
161+
steps:
162+
- name: Get version
163+
id: version
164+
run: |
165+
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
166+
VERSION="${{ inputs.version }}"
167+
else
168+
VERSION="${{ github.event.release.tag_name }}"
169+
fi
170+
echo "version=${VERSION#v}" >> $GITHUB_OUTPUT
171+
172+
- name: Log in to GitHub Container Registry
173+
uses: docker/login-action@v3
174+
with:
175+
registry: ${{ env.REGISTRY }}
176+
username: ${{ github.actor }}
177+
password: ${{ secrets.GITHUB_TOKEN }}
178+
179+
- name: Verify UI image
180+
run: |
181+
docker pull ${{ env.IMAGE_BASE }}-ui:${{ steps.version.outputs.version }}
182+
docker inspect ${{ env.IMAGE_BASE }}-ui:${{ steps.version.outputs.version }}
183+
184+
- name: Verify backend image
185+
run: |
186+
docker pull ${{ env.IMAGE_BASE }}-backend:${{ steps.version.outputs.version }}
187+
docker inspect ${{ env.IMAGE_BASE }}-backend:${{ steps.version.outputs.version }}
188+
189+
- name: Summary
190+
run: |
191+
echo "# 🐳 Docker Images Published!" >> $GITHUB_STEP_SUMMARY
192+
echo "" >> $GITHUB_STEP_SUMMARY
193+
echo "## Images" >> $GITHUB_STEP_SUMMARY
194+
echo "" >> $GITHUB_STEP_SUMMARY
195+
echo "- \`${{ env.IMAGE_BASE }}-ui:${{ steps.version.outputs.version }}\`" >> $GITHUB_STEP_SUMMARY
196+
echo "- \`${{ env.IMAGE_BASE }}-backend:${{ steps.version.outputs.version }}\`" >> $GITHUB_STEP_SUMMARY
197+
echo "" >> $GITHUB_STEP_SUMMARY
198+
echo "## Usage" >> $GITHUB_STEP_SUMMARY
199+
echo "" >> $GITHUB_STEP_SUMMARY
200+
echo '```bash' >> $GITHUB_STEP_SUMMARY
201+
echo "docker pull ${{ env.IMAGE_BASE }}-ui:${{ steps.version.outputs.version }}" >> $GITHUB_STEP_SUMMARY
202+
echo "docker pull ${{ env.IMAGE_BASE }}-backend:${{ steps.version.outputs.version }}" >> $GITHUB_STEP_SUMMARY
203+
echo '```' >> $GITHUB_STEP_SUMMARY
204+
echo "" >> $GITHUB_STEP_SUMMARY
205+
echo "✅ All images verified successfully!" >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)