Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Update 01-run.sh (#282) #84

Update 01-run.sh (#282)

Update 01-run.sh (#282) #84

Workflow file for this run

name: Automatically Build image on tag ONLY
on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+
- v[0-9]+.[0-9]+.[0-9]+-*
jobs:
build:
runs-on: ubuntu-latest
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 libarchive-tools
- 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 "UMBREL_OS_VERSION=$UMBREL_OS_VERSION" >> $GITHUB_ENV
echo "IMAGE_NAME=$IMAGE_NAME" >> $GITHUB_ENV
- 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: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: true
prerelease: false
- name: Upload image
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ${{ env.IMAGE_NAME }}.zip
asset_name: ${{ env.IMAGE_NAME }}.zip
asset_content_type: application/gzip