-
Notifications
You must be signed in to change notification settings - Fork 1
59 lines (50 loc) · 2.07 KB
/
build-templates.yml
File metadata and controls
59 lines (50 loc) · 2.07 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Build templates
on:
workflow_call:
outputs:
artifact-key:
description: "The key of the uploaded artifact"
value: "dist-${{ github.run_id }}-${{ github.run_attempt }}"
templates:
description: "Template filenames and descriptions"
value: ${{ jobs.build.outputs.templates }}
jobs:
build:
runs-on: ubuntu-latest
outputs:
templates: ${{ steps.build.outputs.templates }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.9
cache: pip
- name: Install dependencies
run: pip install -r requirements.txt
- name: Build templates
id: build
run: |
mkdir dist
python template.py -o dist/ecs-fargate-full.yml --launch-type=fargate
echo "ecs-fargate-full.yml => Fargate" >> templates.txt
python template.py -o dist/ecs-fargate-no-network.yml --launch-type=fargate -N
echo "ecs-fargate-no-network.yml => Fargate (no network)" >> templates.txt
python template.py -o dist/ecs-fargate-no-cluster.yml --launch-type=fargate -C -N
echo "ecs-fargate-no-cluster.yml => Fargate (no cluster, no network)" >> templates.txt
python template.py -o dist/ecs-ec2-full.yml --launch-type=ec2
echo "ecs-ec2-full.yml => EC2" >> templates.txt
python template.py -o dist/ecs-ec2-no-network.yml --launch-type=ec2 -N
echo "ecs-ec2-no-network.yml => EC2 (no network)" >> templates.txt
python template.py -o dist/ecs-ec2-no-cluster.yml --launch-type=ec2 -C -N
echo "ecs-ec2-no-cluster.yml => EC2 (no cluster, no network)" >> templates.txt
echo 'templates<<EOF' >> $GITHUB_OUTPUT
cat templates.txt >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
- name: Upload templates
uses: actions/upload-artifact@v4
with:
name: dist-${{ github.run_id }}-${{ github.run_attempt }}
path: dist
retention-days: 1