Skip to content

Commit

Permalink
build workflow hinzugefuegt
Browse files Browse the repository at this point in the history
  • Loading branch information
AlvinSchiller committed Oct 19, 2023
1 parent 6f7a87a commit 08fb4f4
Showing 1 changed file with 81 additions and 0 deletions.
81 changes: 81 additions & 0 deletions .github/workflows/build_docker_debian.yml
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 }}

0 comments on commit 08fb4f4

Please sign in to comment.