From 08fb4f4249328302dbb535c1b1a4d581d6eeb9c0 Mon Sep 17 00:00:00 2001 From: Alvin Schiller <103769832+AlvinSchiller@users.noreply.github.com> Date: Thu, 19 Oct 2023 23:38:55 +0200 Subject: [PATCH] build workflow hinzugefuegt --- .github/workflows/build_docker_debian.yml | 81 +++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 .github/workflows/build_docker_debian.yml diff --git a/.github/workflows/build_docker_debian.yml b/.github/workflows/build_docker_debian.yml new file mode 100644 index 000000000..664f5c54f --- /dev/null +++ b/.github/workflows/build_docker_debian.yml @@ -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/setup-qemu-action@v3.0.0 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3.0.0 + + - 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 }}