Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add example for exporting multiple image stages #123

Closed
Mearman opened this issue May 19, 2024 · 6 comments
Closed

Add example for exporting multiple image stages #123

Mearman opened this issue May 19, 2024 · 6 comments

Comments

@Mearman
Copy link

Mearman commented May 19, 2024

Thank you for such a helpful action!

I'm building an image that just adds one main package (and its dependencies) and then the package's config, as well as updating /boot/firmware/config.txt.

I would like to export the Lite and Full images, but I'm not sure what the best approach is without repeating the whole job.

Is there a better way to do it than something like the following:

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: usimd/pi-gen-action@v1
        id: base
        with:
          stage-list: stage0 stage1 ./custom-stage

    - uses: usimd/pi-gen-action@v1
        id: stage2
        with:
          stage-list: stage2
              - uses: usimd/pi-gen-action@v1

    - uses: actions/upload-artifact@v4
      with:
        name: lite-image
        path: ${{ steps.stage2.outputs.image-path }}

    - uses: usimd/pi-gen-action@v1
        id: stage3
        with:
          stage-list: stage3

    - uses: actions/upload-artifact@v4
      with:
        name: full-image
        path: ${{ steps.stage3.outputs.image-path }}
@Mearman
Copy link
Author

Mearman commented May 19, 2024

Just found the appropriate section in the readme. Though an example would be useful

@usimd
Copy link
Owner

usimd commented May 20, 2024

Thanks for reaching out.

Fully agree, this requires some in-depth understanding of pi-gen's internals and could be made easier for beginners.

Would you like to contribute a suggestion in a PR?

@Mearman
Copy link
Author

Mearman commented May 20, 2024

I'm still fumbling through myself, but I'm getting somewhere. Though do you know what paths I'd need to cache to speed up the pipelines?

@usimd
Copy link
Owner

usimd commented May 22, 2024

pi-gen is by design incremental. Each stage builds upon the previous and you just tell it at which point to export the snapshot to an image.

Caching of the working directory does make sense for repeated development runs of the action, I'm passively working on a feature to introduce that in #106.

But if you want to export multiple images with the same content incrementally adding other components, it's really just one plain pi-gen run you need.

@usimd
Copy link
Owner

usimd commented Jun 7, 2024

Did you figure out everything to get your build goinf, @Mearman? Is there anything missing the documentation or something you'd suggest to improve?

@usimd
Copy link
Owner

usimd commented Sep 9, 2024

Closing for now due to lack of feedback. Feel free to reopen.

@usimd usimd closed this as completed Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants