Generate ramdisk #21
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: Generate ramdisk | |
# This rule triggers when the workflow will run | |
on: | |
# run the workflow manually from Actions tab | |
workflow_dispatch: | |
# jobs can run in sequence or parallel in a workflow | |
jobs: | |
# This single job is called "build" | |
build: | |
# Specify the operating system for the runner job | |
runs-on: ubuntu-latest | |
env: | |
git_hash: $(git rev-parse --short "$GITHUB_SHA") | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# the job gets runned into $GITHUB_WORKSPACE, that is the environment variable for the repo | |
- name: Access current repository | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.ref }} | |
- name: Build docker image | |
run: | | |
docker run -d -p 5000:5000 --name registry registry:2.7 | |
# env git_hash env goes into the compose.yml | |
docker compose -f ./compose.yml --progress=plain build busybox | |
docker push localhost:5000/bubo_builder:latest | |
#podman build -t bubo_builder:latest -f ./utils/busybox/Dockerfile | |
- name: Retrieve artifact from docker image | |
run: | | |
docker run -it --name bubo -d localhost:5000/bubo_builder:latest | |
docker cp bubo:./initramfs.cpio.gz ${{ github.workspace }}/artifacts/ | |
- name: Archive the build artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: bubo | |
# image size: 8.48MB | |
# artifact size: 829.6K | |
path: ${{ github.workspace }}/artifacts/initramfs.cpio.gz | |