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

investigate and discuss composite actions vs reusable workflows #67

Open
xynydev opened this issue Nov 20, 2024 · 2 comments
Open

investigate and discuss composite actions vs reusable workflows #67

xynydev opened this issue Nov 20, 2024 · 2 comments
Labels
priority: low Might be supported or done in the future, but won't be prioritised type: discussion Questions, proposals and info that requires discussion.

Comments

@xynydev
Copy link
Member

xynydev commented Nov 20, 2024

Currently the BlueBuild GitHub Action is a composite action.

It could also technically be a reusable workflow.
This would allow us to specify custom build matrices inside the reusable component, centralizing the way the workflow is configured, and possibly allowing us to integrate a more complex build system for creating recipes (ex. jsonnet) within the GitHub matrixing.

The composite action could still live alongside the reusable workflow, and be used by it. We could switch to using the reusable workflow by default in the template, since it would have more streamlined configuration and more features. Falling back to using the composite action would be possible for power users to do 'unsupported things' (such as #53), too, of course.

Read more about the differences here:
https://docs.github.com/en/actions/sharing-automations/avoiding-duplication

@xynydev xynydev added type: discussion Questions, proposals and info that requires discussion. priority: low Might be supported or done in the future, but won't be prioritised labels Nov 20, 2024
@gmpinder
Copy link
Member

Do you have an example of what that would look like to the end user?

@xynydev
Copy link
Member Author

xynydev commented Nov 23, 2024

This is adapted from m2's setup without testing

name: Build images
on:
  schedule:
    - cron: "00 06 * * *" # build at 06:00 UTC every day 
                          # (20 minutes after last ublue images start building)
  push:
    branches: 
      - main
  pull_request:
    branches:
      - main
  merge_group:
  workflow_dispatch:

permissions:
  contents: write
  packages: write
  id-token: write

jobs:
  build-images:
    name: Build images
    uses: blue-build/workflow/[email protected]
    secrets: inherit
    with:
      recipe:
          # !! Add your recipes here 
          - recipe.yml

       # enabled by default, set to false if your image is small and you want faster builds      
       maximize_build_space: true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: low Might be supported or done in the future, but won't be prioritised type: discussion Questions, proposals and info that requires discussion.
Projects
None yet
Development

No branches or pull requests

2 participants