chore: add pull request build (#557)

This commit is contained in:
RoyalOughtness
2024-11-12 22:51:26 -08:00
committed by GitHub
parent 986f3fe109
commit 2c5142597e

64
.github/workflows/pull_request.yml vendored Normal file
View File

@@ -0,0 +1,64 @@
name: build-pullrequest
on:
pull_request:
branches:
- live
paths-ignore:
- "**.md"
jobs:
bluebuild:
name: PR build
runs-on: ubuntu-24.04
permissions:
contents: read
strategy:
fail-fast: false
matrix:
recipe:
- general/recipe-silverblue-main-userns.yml
steps:
- name: Checkout repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Maximize build space
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
- name: Determine Vars
id: build_vars
shell: bash
env:
RECIPE: ${{ matrix.recipe }}
run: |
RECIPE_PATH=""
if [ -f "./config/${RECIPE}" ]; then
RECIPE_PATH="./config/${RECIPE}"
else
RECIPE_PATH="./recipes/${RECIPE}"
fi
echo "recipe_path=${RECIPE_PATH}" >> ${GITHUB_OUTPUT}
- name: Install BlueBuild
shell: bash
env:
CLI_VERSION_TAG: ${{ steps.build_vars.outputs.cli_version }}
run: |
docker create \
--name blue-build-installer \
ghcr.io/blue-build/cli:v0.8.20-installer
docker cp blue-build-installer:/out/bluebuild /usr/local/bin/bluebuild
docker rm blue-build-installer
bluebuild --version
- name: Build Image
shell: bash
working-directory: ${{ inputs.working_directory }}
env:
RECIPE_PATH: ${{ steps.build_vars.outputs.recipe_path }}
RUST_LOG_STYLE: always
CLICOLOR_FORCE: '1'
GH_PR_EVENT_NUMBER: ${{ github.event.number }}
run: |
BUILD_OPTS="--build-driver podman --squash"
bluebuild build -v ${BUILD_OPTS} ${RECIPE_PATH}