-
Notifications
You must be signed in to change notification settings - Fork 199
43 lines (37 loc) · 1.05 KB
/
packer-build-ami.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
43
name: Packer build AWS AMI's
on:
workflow_dispatch:
branches:
- prod
jobs:
plan:
environment: Terraform
defaults:
run:
working-directory: /home/runner/work/ballerine/deploy/aws_ami
runs-on: ubuntu-latest
name: Packer build Artifacts
steps:
- name: Checkout to Git
uses: actions/checkout@v2
- name: Assume Role
uses: ./
env:
ROLE_ARN: ${{ secrets.AWS_PACKER_ROLE }}
ROLE_SESSION_NAME: packersession
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
DURATION_SECONDS: 900
- name: Setup `packer`
uses: hashicorp/setup-packer@main
id: setup
with:
version: 1.8.7
- name: Run `packer init`
id: init
run: "packer init template.json.pkr.hcl"
- name: Run `packer validate`
id: validate
run: "packer validate template.json.pkr.hcl"
- name: Build AWS AMIs
run: "packer build template.json.pkr.hcl"