-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (39 loc) · 1.15 KB
/
structure-test.yml
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
on: workflow_dispatch
jobs:
packer-build:
runs-on: ubuntu-latest
name: Packer AMI Build
outputs:
ami_id: ${{ steps.packer.outputs.ami_id }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Run Packer Build
id: packer
working-directory: ./aws/test-ec2-secrets/packer
run: |
# write manifest.json to disk
echo '{
"builds": [
{
"artifact_id": "aws-ami:us-east-1:ami-0a1234567890abcdef"
}
]
}' > manifest.json
cat manifest.json | jq -r '.builds[-1].artifact_id' | cut -d':' -f2
ami_id=$(manifest.json | jq -r '.builds[-1].artifact_id' | cut -d':' -f2)
echo "ami_id=${ami_id}" | tee -a $GITHUB_OUTPUT
terraform-build:
runs-on: ubuntu-latest
name: Gitstafette AWS VM Rebuild
needs: packer-build
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Run Terraform Plan
env:
AMI_ID: ${{ needs.packer-build.outputs.ami_id }}
id: terraform-plan
working-directory: ./aws/test-ec2-secrets/terraform
run: |
echo "AMI_ID=${AMI_ID}"