ci: move to self-hosted action runner #8
Workflow file for this run
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: Vagrant install | |
on: | |
pull_request: | |
types: [opened, reopened, synchronize] | |
env: | |
LIBVIRT_DEFAULT_URI: "qemu:///system" | |
jobs: | |
main: | |
name: Build and deploy | |
runs-on: | |
- self-hosted | |
- Linux | |
- kvm | |
- vagrant | |
- equinix | |
steps: | |
- uses: actions/checkout@v3 | |
# - name: Build Harvester artifacts | |
# run: | | |
# export USE_LOCAL_IMAGES=true | |
# make | |
- name: Clone and checkout ipxe-examples | |
id: ipxe | |
run: | | |
cd $HOME | |
if [ ! -d ipxe-examples ]; then | |
git clone https://github.com/harvester/ipxe-examples.git | |
fi | |
cd ipxe-examples | |
git reset && git checkout . | |
git clean -fd | |
git pull | |
echo "VAGRANT_HOME=$HOME/ipxe-examples/vagrant-pxe-harvester" >> $GITHUB_OUTPUT | |
- name: Clean up previous vagrant deployment | |
run: | | |
cd ${{ steps.ipxe.outputs.VAGRANT_HOME }} | |
vagrant destroy -f --parallel | |
- name: Remove OVMF.fd line if needed | |
run: | | |
cd ${{ steps.ipxe.outputs.VAGRANT_HOME }} | |
if [ ! -f /usr/share/qemu/OVMF.fd ]; then | |
echo "Remove libvirt loader: can't find UEFI firmware" | |
sed 's/libvirt.loader.*/#libvirt.loader = /' Vagrantfile | |
fi | |
- name: Generate SSH keys | |
run: | | |
ssh-keygen -t rsa -q -N "" -f ./ci/terraform/tmp-ssh-key | |
- name: Set SSH key in ipxe-examples settings | |
run: | | |
export PUB_KEY=$(cat ./ci/terraform/tmp-ssh-key.pub) | |
yq e -i ".harvester_config.ssh_authorized_keys += [ strenv(PUB_KEY) ]" ${{ steps.ipxe.outputs.VAGRANT_HOME }}/settings.yml |