-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add support for recipes in ./recipes and add cache support (#39)
* feat: Add support for recipes in ./recipes and add cache support * Use docker-container driver
- Loading branch information
Showing
1 changed file
with
24 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,6 +50,13 @@ inputs: | |
Example: `ublue-os` | ||
required: false | ||
default: ${{ github.repository_owner }} | ||
use_cache: | ||
description: | | ||
Make use of docker buildx cache. This is an experimental feature of docker buildx | ||
so it isn't guaranteed to work. | ||
Input must match the string 'true' for the step to be enabled. | ||
required: false | ||
default: 'true' | ||
|
||
runs: | ||
using: "composite" | ||
|
@@ -64,7 +71,8 @@ runs: | |
uses: docker/setup-buildx-action@v3 | ||
with: | ||
install: true | ||
driver: docker | ||
driver: docker-container | ||
cache-binary: ${{ inputs.use_cache }} | ||
|
||
- name: Install BlueBuild | ||
shell: bash | ||
|
@@ -85,6 +93,12 @@ runs: | |
- uses: actions/checkout@v4 | ||
- uses: sigstore/[email protected] | ||
|
||
# Required in order for docker buildx to | ||
# take advantage of the GHA cache API | ||
- name: Expose GitHub Runtime | ||
if: ${{ inputs.use_cache == 'true' }} | ||
uses: crazy-max/ghaction-github-runtime@v3 | ||
|
||
|
||
# blue-build/cli does the heavy lifting | ||
- name: Build Image | ||
|
@@ -93,7 +107,15 @@ runs: | |
COSIGN_PRIVATE_KEY: ${{ inputs.cosign_private_key }} | ||
GH_TOKEN: ${{ inputs.registry_token }} | ||
GH_PR_EVENT_NUMBER: ${{ inputs.pr_event_number }} | ||
RECIPE: ${{ inputs.recipe }} | ||
BB_BUILDKIT_CACHE_GHA: ${{ inputs.use_cache }} | ||
run: | | ||
bluebuild build -v --push ./config/${{ inputs.recipe }} \ | ||
RECIPE_PATH="" | ||
if [ -f "./config/${RECIPE}" ]; then | ||
RECIPE_PATH="./config/${RECIPE}" | ||
else | ||
RECIPE_PATH="./recipes/${RECIPE}" | ||
fi | ||
bluebuild build -v --push ${RECIPE_PATH} \ | ||
--registry ${{inputs.registry}} \ | ||
--registry-namespace ${{inputs.registry_namespace}} |