Skip to content

Commit

Permalink
update homarr action
Browse files Browse the repository at this point in the history
  • Loading branch information
Soubinan committed Feb 28, 2024
1 parent c0fa38b commit f88f7ee
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 16 deletions.
40 changes: 25 additions & 15 deletions .github/workflows/build_template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ on:
push:
branches: ["main"]
pull_request:
branches: ["dev"]
branches:
- main
- dev

env:
PROJECT_URL: https://github.com/soubinan/homelab-lxc
AUTHOR: https://github.com/soubinan
VERSION: 1.0.1

jobs:
build:
Expand All @@ -22,24 +23,33 @@ jobs:
steps:
- name: Install Distrobuilder
run: |
apt update
apt install -y golang-go debootstrap rsync gpg squashfs-tools git make
mkdir -p $HOME/go/src/github.com/lxc/
cd $HOME/go/src/github.com/lxc/
git clone https://github.com/lxc/distrobuilder
cd ./distrobuilder
make
cp $HOME/go/bin/distrobuilder /usr/bin/distrobuilder
mkdir /output
sudo apt-get install debootstrap squashfs-tools
sudo snap install distrobuilder --classic
# sudo apt-get update -y
# sudo apt-get install -y golang-go debootstrap rsync gpg squashfs-tools git make
# mkdir -p $HOME/go/src/github.com/lxc/
# cd $HOME/go/src/github.com/lxc/
# git clone https://github.com/lxc/distrobuilder
# cd ./distrobuilder
# sudo make
# cp $HOME/go/bin/distrobuilder /usr/bin/distrobuilder
mkdir $HOME/output
- name: Get Homarr version
run: |
echo "HOMARR_VERSION="$(curl -s https://raw.githubusercontent.com/ajnart/homarr/master/package.json | jq -r ".version") >> $GITHUB_ENV
- name: Check out repository code
uses: actions/checkout@v4

- name: Build Image
if: github.event_name == 'pull_request'
run: |
pwd
distrobuilder build-lxc templates/homarr.yaml -o image.architecture=${{ matrix.architecture }} -o image.release=${{ matrix.release }} -o image.variant=cloud -o source.url="http://ftp.us.debian.org/debian" /output
sudo distrobuilder build-lxc ${{ github.workspace }}/templates/homarr.yaml -o image.architecture=${{ matrix.architecture }} -o image.release=${{ matrix.release }} -o image.variant=cloud -o source.url="http://ftp.us.debian.org/debian" $HOME/output
ls -lash
- name: Publish Artefacts
if: github.event_name == 'push'
run: |
mv /output/rootfs.tar.xz /output/homarr-$VERSION.rootfs.tar.xz
mv /output/meta.tar.xz /output/homarr-$VERSION.meta.tar.xz
mv $HOME/output/rootfs.tar.xz /output/homarr-$HOMARR_VERSION.rootfs.tar.xz
mv $HOME/output/meta.tar.xz /output/homarr-$HOMARR_VERSION.meta.tar.xz
1 change: 0 additions & 1 deletion templates/homarr.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -o image.architecture=amd64 -o image.release=bookworm -o image.variant=cloud -o source.url="http://ftp.us.debian.org/debian"
image:
distribution: debian
release: stable
Expand Down

0 comments on commit f88f7ee

Please sign in to comment.