CI #18
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: build | |
on: [workflow_dispatch, push] | |
jobs: | |
build: | |
name: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup `packer` | |
uses: hashicorp/setup-packer@main | |
id: setup | |
# - name: Setup arm packer prerequisites | |
# run: | | |
# sudo add-apt-repository ppa:longsleep/golang-backports | |
# sudo apt-get update | |
# sudo apt-get install golang-go | |
# sudo apt-get install qemu-user-static | |
# - name: Build packer-builder-arm | |
# run: | | |
# git clone https://github.com/mkaczanowski/packer-builder-arm.git | |
# cd packer-builder-arm | |
# go mod download | |
# go build | |
# Install dependencies for packer | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install fdisk gdisk qemu-user-static libarchive-tools tar parted qemu-utils squashfs-tools -y | |
shell: bash | |
# Install packer arm plugin | |
- name: Install packer-builder-arm | |
run: | | |
git clone https://github.com/mkaczanowski/packer-builder-arm plugin | |
cd plugin | |
go mod download | |
go build | |
shell: bash | |
- name: init example image | |
run: | | |
cp plugin/packer-builder-arm . | |
packer init plugin/boards/raspberry-pi-4/ubuntu_server_20.04_arm64.pkr.hcl | |
shell: bash | |
- name: Build example image | |
run: | | |
packer build plugin/boards/raspberry-pi-4/ubuntu_server_20.04_arm64.pkr.hcl | |
shell: bash | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: ubuntu-20.04.img |