-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (38 loc) · 1.14 KB
/
image.yaml
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
name: Build webserver AMI
run-name: ${{ github.actor }} ran the scheduled job.
on:
workflow_dispatch:
jobs:
packer:
runs-on: ubuntu-latest
env:
TF_VAR_vpc_id: ${{ secrets.VPC_ID }}
TF_VAR_domain: ${{ secrets.TF_VAR_domain }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
steps:
- uses: actions/checkout@v3
# Initialize Packer templates
- name: initialize
uses: hashicorp/packer-github-actions@master
with:
command: init
working_directory: ./packer
# validate templates
- name: validate
uses: hashicorp/packer-github-actions@master
with:
command: validate
arguments: -syntax-only
target: webserver.pkr.hcl
working_directory: ./packer
# build artifact
- name: build
uses: hashicorp/packer-github-actions@master
with:
command: build
arguments: "-color=false -on-error=abort"
target: webserver.pkr.hcl
working_directory: ./packer
env:
PACKER_LOG: 1