Skip to content

Switched to shell provisioning #24

Switched to shell provisioning

Switched to shell provisioning #24

Workflow file for this run

---
name: release
# This workflow requires a VAGRANTCLOUD_TOKEN secret to be defined in the GitHub
# repository settings.
on:
push:
branches: [main]
paths:
- .github/workflows/release.yml
- Vagrantfile
schedule:
# Runs automatically on the 27th of every month at 05:30 UTC. This is
# because it has to run after https://github.com/dmotte/vagrant-ansiblebox
- cron: "30 05 27 * *"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
release:
# We use this virtual environment because it supports nested virtualization.
# See https://github.com/actions/virtual-environments/issues/433 for more
# information
runs-on: macos-12
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cache Vagrant boxes
# Caches that are not accessed within the last week will be evicted
# (see https://github.com/actions/cache#cache-limits)
uses: actions/cache@v3
with:
path: ~/.vagrant.d/boxes
key: ${{ runner.os }}-vagrant-${{ hashFiles('Vagrantfile') }}
restore-keys: |
${{ runner.os }}-vagrant-
- name: Vagrant base box update
run: vagrant box update
- name: Bring up the VM
run: vagrant up --provision
- name: Create the package.box file
run: vagrant package
- name: Destroy the VM
run: vagrant destroy -f
- name: Login to Vagrant Cloud
run: vagrant cloud auth login --token "${{ secrets.VAGRANTCLOUD_TOKEN }}"
- name: Publish the box to Vagrant Cloud
run: >
vagrant cloud publish
-s "Debian Vagrant box with Vagrant and VirtualBox for nested virtualization (github.com/dmotte/vagrant-vagrantbox)"
--version-description "This version has been released automatically with GitHub Actions, commit ${{ github.sha }}"
--no-private --release --force
dmotte/vagrantbox "$(date +%Y.%m.%d.%H%M)" virtualbox package.box