corner11 #6
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: Image build | |
on: | |
push: | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: Build image | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install fdisk gdisk qemu-user-static libarchive-tools tar | |
- name: Checkout | |
uses: actions/checkout@v3.3.0 | |
with: | |
fetch-depth: 0 | |
- name: Build image | |
run: | | |
chmod +x ./build.sh | |
./build.sh | |
du -h ${{ github.workspace }}/*.img.xz | |
- name: Get output name | |
id: git-desc | |
run: | | |
echo "git_desc=$(git describe --tags --always)" >> $GITHUB_ENV | |
echo "image_path=$(realpath ${{ github.workspace }}/*.img.xz)" >> $GITHUB_ENV | |
echo "image_name=$(basename ${{ github.workspace }}/*.img.xz)" >> $GITHUB_ENV | |
- name: Save image artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: kiosk-${{ env.git_desc }} | |
path: ${{ env.image_path }} |