forked from MiczFlor/RPi-Jukebox-RFID
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6f7a87a
commit 08fb4f4
Showing
1 changed file
with
81 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,81 @@ | ||
name: Build Debian Image | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
debian_version_name: | ||
required: true | ||
type: choice | ||
description: debian version | ||
default: 'bullseye' | ||
options: | ||
- buster | ||
- bullseye | ||
platform: | ||
required: true | ||
type: string | ||
description: platform | ||
default: 'linux/arm/v7' | ||
target: | ||
required: true | ||
type: choice | ||
description: Dockerfile target | ||
default: 'linux/arm/v7' | ||
options: | ||
- code | ||
- test-code | ||
|
||
|
||
# let only one instance run the test so cache is not corrupted. | ||
# cancel already running instances as only the last run will be relevant | ||
concurrency: | ||
group: ${{ github.ref }}-build-debian | ||
cancel-in-progress: true | ||
|
||
env: | ||
DOCKER_IMAGE_NAME: rpi-jukebox-rfid | ||
|
||
jobs: | ||
|
||
# Build container and run tests | ||
run: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up QEMU | ||
uses: docker/[email protected] | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/[email protected] | ||
|
||
- name: Set Output vars | ||
id: vars | ||
env: | ||
DEBIAN_VERSION_NAME: ${{ inputs.debian_version_name }} | ||
run: | | ||
echo "image_tag_name=${{ env.DOCKER_IMAGE_NAME }}:${{ env.DEBIAN_VERSION_NAME }}-latest" >> $GITHUB_OUTPUT | ||
echo "image_file_name=${{ env.DOCKER_IMAGE_NAME }}-${{ env.DEBIAN_VERSION_NAME }}.tar" >> $GITHUB_OUTPUT | ||
# Build base image for debian version name | ||
- name: Build Debian Image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
load: false | ||
push: false | ||
file: ./ci/Dockerfile.debian | ||
target: ${{ inputs.target }} | ||
platforms: ${{ inputs.platform }} | ||
tags: ${{ steps.vars.outputs.image_tag_name }} | ||
outputs: type=docker,dest=./${{ steps.vars.outputs.image_file_name }} | ||
build-args: | | ||
DEBIAN_VERSION_NAME=${{ inputs.debian_version_name }} | ||
GIT_BRANCH=${{ github.head_ref || github.ref_name }} | ||
GIT_URL=${{ github.server_url }}/${{ github.repository }} | ||
- name: Upload Debian Image | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ steps.vars.outputs.image_file_name }} | ||
path: ./${{ steps.vars.outputs.image_file_name }} |