-
Notifications
You must be signed in to change notification settings - Fork 4
64 lines (53 loc) · 1.62 KB
/
packMachines.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Pack Virtual Machine Images
on:
push:
branches:
- main
workflow_call:
inputs:
service:
required: true
type: string
version:
required: true
type: string
permissions:
contents: read
jobs:
workflow_changes:
with:
what_to_check: ./.github
uses: ./.github/workflows/checkForChanges.yml
packer_changes:
with:
what_to_check: ./packer
uses: ./.github/workflows/checkForChanges.yml
packer_build:
if: needs.workflow_changes.outputs.has_changes == 'true' || needs.packer_changes.outputs.has_changes == 'true'
runs-on: ubuntu-latest
strategy:
matrix:
include:
- provisioners: ${{ inputs.provisioners }}
steps:
- uses: actions/checkout@v4
- name: Set up Packer
uses: hashicorp/setup-packer@1aa358be5cf73883762b302a3a03abd66e75b232
with:
version: 1.11.2
# Needed for ISO builder
- name: Set up QEMU
uses: docker/setup-qemu-action@4574d27a4764455b42196d70a065bc6853246a25
- name: Run `packer init`
working-directory: ./packer
id: init
run: "packer init ./ubuntu.pkr.hcl"
- name: Run `packer validate`
working-directory: ./packer
id: validate
run: "packer validate ./ubuntu.pkr.hcl"
## TODO: Add matrixed provisioner build here
- name: Build Packer Image
working-directory: ./packer
run: packer build --var dibbs_service=${{ inputs.service }} --var dibbs_version=${{ inputs.version }} ./ubuntu.pkr.hcl
## TODO: Decide how to export artifact.