Build ISO Image #14
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: Publish ISO Image | |
# Avoids having multiple instances running | |
concurrency: | |
group: build-iso | |
cancel-in-progress: true | |
on: | |
push: | |
tags: | |
- "v*" | |
workflow_dispatch: | |
inputs: | |
generate_iso: | |
description: 'Generate ISO image' | |
required: true | |
type: boolean | |
default: false | |
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 icpc_build | |
- name: Create Release | |
uses: actions/create-release@v1 | |
if: ${{ github.event.inputs.generate_iso }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GENERATE_ISO: ${{ github.event.inputs.generate_iso }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: ${{ env.image_name }} | |
draft: false | |
prerelease: false | |
- name: Split ISO | |
if: ${{ github.event.inputs.generate_iso }} | |
run: then mkdir iso-parts; split -b 2000MB live-build/contestant.iso iso-parts/contestant | |
env: | |
GENERATE_ISO: ${{ github.event.inputs.generate_iso }} | |
- name: Upload ISO | |
if: ${{ github.event.inputs.generate_iso }} | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: iso-parts/contestant* | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |