You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.9 KiB

name: Build image on push or PR
on: ["push", "pull_request"]
jobs:
build:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
- name: Run Apt-get update
run: sudo apt-get update
- name: Install dependencies
run: sudo apt-get -y install quilt qemu-user-static debootstrap bsdtar
- name: Nuke current Docker installation
run: |
sudo systemctl stop docker
sudo apt-get purge docker-ce docker-ce-cli containerd.io moby-engine moby-cli
sudo rm -rf /var/lib/docker
- name: Re-install Docker
run: |
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
docker --version
- name: Enable experimental features in Docker
run: |
sudo rm -rf /etc/docker/daemon.json
echo '{"experimental": true}' | sudo tee -a /etc/docker/daemon.json
sudo systemctl restart docker
- name: Set image name
run: |
UMBREL_OS_VERSION="$(git describe --tags)"
IMAGE_NAME="umbrel-os-${UMBREL_OS_VERSION}"
echo "::set-env name=UMBREL_OS_VERSION::$UMBREL_OS_VERSION"
echo "::set-env name=IMAGE_NAME::$IMAGE_NAME"
- name: Run build script
run: |
echo "Building $IMAGE_NAME"
sudo IMG_FILENAME=$IMAGE_NAME ZIP_FILENAME=$IMAGE_NAME UMBREL_OS_VERSION=$UMBREL_OS_VERSION ./build.sh
- name: Copy ZIP to current working dir
run: cp deploy/*.zip ./
- name: Debug current working dir
run: ls -la
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
path: ${{ env.IMAGE_NAME }}.zip
name: ${{ env.IMAGE_NAME }}.zip