Move shell run commands from action.yml
to a script, for use beyond…
#18
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-os | |
on: | |
pull_request: | |
branches: | |
- main | |
paths-ignore: | |
- '**/README.md' | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- '**/README.md' | |
merge_group: | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build test image | |
strategy: | |
fail-fast: false | |
matrix: | |
destination: | |
- name: implicit | |
path: '' | |
- name: explicit | |
path: 'destination.img' | |
- name: explicit-gz | |
path: 'destination.img.gz' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Make a Pifile for Pimod | |
uses: 1arp/create-a-file-action@0.4.5 | |
with: | |
file: cowsay.Pifile | |
content: | | |
FROM https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2024-03-15/2024-03-15-raspios-bookworm-arm64-lite.img.xz | |
TO cowsay-image.img | |
PUMP 8G | |
# Install and test out cowsay: | |
RUN apt-get update | |
RUN apt-get install -y cowsay | |
RUN /usr/games/cowsay "I'm running in a chroot!" | |
- name: Build the image | |
uses: Nature40/pimod@master | |
with: | |
pifile: cowsay.Pifile | |
- name: Shrink the image | |
id: shrink-image | |
uses: ./ | |
with: | |
image: cowsay-image.img | |
destination: ${{ matrix.destination.path }} | |
compress: gzip | |
compress-parallel: true | |
- name: Upload image to Job Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: rpi-cowsay-${{ matrix.destination.name }}-arm64-latest | |
path: ${{ steps.shrink-image.outputs.destination }} | |
if-no-files-found: error | |
retention-days: 0 | |
compression-level: 0 | |
overwrite: true |