Skip to content

don't cache the iso

don't cache the iso #8

Workflow file for this run

name: Build OVF Image
on:
push:
branches:
- ova
workflow_dispatch:
inputs:
core_tag:
description: "defguard core image tag"
required: true
proxy_tag:
description: "defguard proxy image tag"
required: true
gateway_tag:
description: "defguard gateway image tag"
required: true
env:
DEFAULT_TAG: "2.0.0-alpha2"
jobs:
build:
runs-on: [self-hosted, Linux, X64]
defaults:
run:
working-directory: ova
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends ovmf awscli
- name: Check KVM availability
run: |
ls -la /dev/kvm
echo "test"
id
[ -r /dev/kvm ] && echo "KVM readable" || echo "KVM NOT readable"
- name: Setup Packer
uses: hashicorp/setup-packer@main
with:
version: latest
- name: Download ISO
run: |
curl -fL -o ubuntu-24.04.4-live-server-amd64.iso \
https://releases.ubuntu.com/24.04.4/ubuntu-24.04.4-live-server-amd64.iso
- name: Packer init
run: packer init defguard.pkr.hcl
- name: Packer build
env:
PACKER_LOG: 1
run: |
packer build \
-var "iso_url=file://$PWD/ubuntu-24.04.4-live-server-amd64.iso" \
-var "core_tag=${{ github.event.inputs.core_tag || env.DEFAULT_TAG }}" \
-var "proxy_tag=${{ github.event.inputs.proxy_tag || env.DEFAULT_TAG }}" \
-var "gateway_tag=${{ github.event.inputs.gateway_tag || env.DEFAULT_TAG }}" \
defguard.pkr.hcl
- name: Upload OVA to S3
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: eu-central-1
CORE_TAG: ${{ github.event.inputs.core_tag || env.DEFAULT_TAG }}
PROXY_TAG: ${{ github.event.inputs.proxy_tag || env.DEFAULT_TAG }}
GATEWAY_TAG: ${{ github.event.inputs.gateway_tag || env.DEFAULT_TAG }}
run: |
TIMESTAMP=$(date +%Y%m%d-%H%M%S)
FILENAME="defguard_${TIMESTAMP}_core-${CORE_TAG}_edge-${PROXY_TAG}_gateway-${GATEWAY_TAG}.ova"
ls -lh output/defguard/defguard.ova
aws s3 cp output/defguard/defguard.ova "s3://defguard-downloads/ova/${FILENAME}"
echo "Uploaded: s3://defguard-downloads/ova/${FILENAME}"