Skip to content

Commit

Permalink
Merge pull request #2 from minhnhatnoe/master
Browse files Browse the repository at this point in the history
Automated image builder
  • Loading branch information
minhnhatnoe authored Jul 11, 2023
2 parents cf7160e + 3449628 commit 6484252
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 0 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Publish ISO Image

# Avoids having multiple instances running
concurrency:
group: build-iso
cancel-in-progress: true

on:
push:
tags:
- "v*"

env:
image_name: "VNOI Ubuntu ${{ github.ref }}"

jobs:
build:
name: Build and push image
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Write authorized_keys
run: echo $CONTENT | base64 -d > $FILENAME
env:
CONTENT: ${{ secrets.AUTHORIZED_KEYS }}
FILENAME: authorized_keys

- name: Write local_config.sh
run: echo $CONTENT | base64 -d > $FILENAME
env:
CONTENT: ${{ secrets.LOCAL_CONFIG }}
FILENAME: local_config.sh

- name: Write config.local.sh
run: echo $CONTENT | base64 -d > $FILENAME
env:
CONTENT: ${{ secrets.CONFIG_LOCAL_SH }}
FILENAME: src/config.local.sh

- name: Write config.sh
run: echo $CONTENT | base64 -d > $FILENAME
env:
CONTENT: ${{ secrets.CONFIG_SH }}
FILENAME: src/config.sh

- name: Build image
run: sudo ./build.sh build

- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ env.image_name }}
draft: false
prerelease: false

- name: Split ISO
run: mkdir iso-parts; split -b 2000MB live-build/contestant.iso iso-parts/contestant

- name: Upload ISO
uses: softprops/action-gh-release@v1
with:
files: iso-parts/contestant*
1 change: 1 addition & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ fi

build() {
# Install dependencies for building the ISO
apt-get update
apt-get install \
binutils \
debootstrap \
Expand Down
1 change: 1 addition & 0 deletions chroot_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ mount none -t proc /proc
mount none -t sysfs /sys
mount none -t devpts /dev/pts

export DEBIAN_FRONTEND=noninteractive
export HOME=/root
export LC_ALL=C

Expand Down

0 comments on commit 6484252

Please sign in to comment.