Build ISO Image #27
Workflow file for this run
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: Build 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: 'Choose generated ISO file storage location' | |
required: false | |
type: choice | |
options: | |
- 'server' | |
- 'release' | |
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: src/misc/authorized_keys | |
- name: Write config.local.sh | |
run: echo $CONTENT | base64 -d > $FILENAME | |
env: | |
CONTENT: ${{ secrets.CONFIG_LOCAL_SH }} | |
FILENAME: config.local.sh | |
- name: Write src/config.local.sh | |
run: echo $CONTENT | base64 -d > $FILENAME | |
env: | |
CONTENT: ${{ secrets.SRC_CONFIG_LOCAL_SH }} | |
FILENAME: src/config.local.sh | |
- name: Write src/config.sh | |
run: echo $CONTENT | base64 -d > $FILENAME | |
env: | |
CONTENT: ${{ secrets.SRC_CONFIG_SH }} | |
FILENAME: src/config.sh | |
- name: Build image | |
run: sudo ./build.sh icpc_build --github-actions | |
# ----------------------- # | |
# Push to Github Releases # | |
# ----------------------- # | |
- name: Create Release | |
uses: actions/create-release@v1 | |
if: ${{ github.event.inputs.generate_iso == 'release' }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: ${{ env.image_name }} | |
draft: false | |
prerelease: false | |
- name: Split ISO | |
if: ${{ github.event.inputs.generate_iso == 'release' }} | |
run: then mkdir iso-parts; split -b 2000MB live-build/contestant.iso iso-parts/contestant | |
- name: Upload ISO | |
if: ${{ github.event.inputs.generate_iso == 'release' }} | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: iso-parts/contestant* | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# ----------------------- # | |
# Push to Server # | |
# ----------------------- # | |
- name: Push to Server | |
if: ${{ github.event.inputs.generate_iso == 'server' }} | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.SCP_HOST }} | |
username: ${{ secrets.SCP_USERNAME }} | |
key: ${{ secrets.SCP_KEY }} | |
port: ${{ secrets.SCP_PORT }} | |
source: live-build/contestant.iso | |
target: ${{ secrets.SCP_TARGET }} |