-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from minhnhatnoe/master
Automated image builder
- Loading branch information
Showing
3 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
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
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* |
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
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