Update github action. #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Pack Virtual Machine Images | |
on: | |
push: | |
branches: | |
- main | |
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 | |
terraform_changes: | |
with: | |
what_to_check: ./terraform | |
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@v3 | |
with: | |
version: 1.11.2 | |
# Needed for ISO builder | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- 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 ./ubuntu.pkr.hcl | |
## TODO: Decide how to export artifact. |