Skip to content

Make cache dir on job start #82

Make cache dir on job start

Make cache dir on job start #82

Workflow file for this run

name: Build NAV appliance
on: [push, pull_request, workflow_dispatch]
jobs:
packer:
name: "Build appliance using Packer"
runs-on: macos-12
permissions:
contents: write
env:
PACKER_LOG: 1
PACKER_CACHE: ~/.cache/packer
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Create packer cache directory
run: |
mkdir -p $PACKER_CACHE
- name: Get ISO checksums
id: get-checksum
run: |
echo "checksum=$(cat bullseye.json | jq '.builders[].iso_checksum')" >> $GITHUB_OUTPUT
shell: bash
- name: "Cache downloaded packer images"
uses: actions/cache/save@v3
if: always()
id: packer-cache
with:
path: ~/.cache/packer
key: ${{ steps.get-checksum.outputs.checksum }}
- name: Install virtualbox plugin
run: |
packer plugins install github.com/hashicorp/virtualbox
- name: Validate Template
run: |
packer validate bullseye.json
- name: Build Artifact
run: |
packer build bullseye.json
- name: List directory contents
if: always()
run: |
ls -la $PWD
- name: Upload video artifact
uses: actions/upload-artifact@v2
with:
name: video
path: |
**/*.webm
- name: Upload appliance artifact
uses: actions/upload-artifact@v2
with:
name: navappliance
path: |
navappliance/**/*