Skip to content

Commit e57d0e9

Browse files
authored
Create test-loop.yml
1 parent df4bb91 commit e57d0e9

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

.github/workflows/test-loop.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
name: Sync Ansible Project
3+
on:
4+
push:
5+
branches: [development]
6+
7+
jobs:
8+
define-matrix:
9+
runs-on: ubuntu-latest
10+
11+
outputs:
12+
colors: ${{ steps.colors.outputs.colors }}
13+
14+
steps:
15+
- name: Define Colors
16+
id: colors
17+
run: |
18+
echo 'colors=["red", "green", "blue"]' >> "$GITHUB_OUTPUT"
19+
20+
produce-artifacts:
21+
runs-on: ubuntu-latest
22+
needs: define-matrix
23+
strategy:
24+
matrix:
25+
color: ${{ fromJSON(needs.define-matrix.outputs.colors) }}
26+
27+
steps:
28+
- name: Define Color
29+
env:
30+
color: ${{ matrix.color }}
31+
run: |
32+
echo "$color" > color
33+
- name: Produce Artifact
34+
uses: actions/upload-artifact@v4
35+
with:
36+
name: ${{ matrix.color }}
37+
path: color
38+
39+
consume-artifacts:
40+
runs-on: ubuntu-latest
41+
needs:
42+
- define-matrix
43+
- produce-artifacts
44+
strategy:
45+
matrix:
46+
color: ${{ fromJSON(needs.define-matrix.outputs.colors) }}
47+
48+
steps:
49+
- name: Retrieve Artifact
50+
uses: actions/download-artifact@v4
51+
with:
52+
name: ${{ matrix.color }}
53+
54+
- name: Report Color
55+
run: |
56+
cat color

0 commit comments

Comments
 (0)