Skip to content

Add content database in RPM and DEB packages #168

Add content database in RPM and DEB packages

Add content database in RPM and DEB packages #168

name: Upload package creation Docker images - DEB - amd64 and i386
on:
pull_request:
paths:
- 'debs/Debian/**'
- 'debs/build.sh'
types:
- opened
- synchronize
- closed
workflow_dispatch:
jobs:
Upload-deb-package-building-images:
runs-on: ubuntu-latest
strategy:
matrix:
image: [ {CONTAINER_NAME: deb_manager_builder_amd64, DOCKERFILE_PATH: debs/Debian/8/amd64}, {CONTAINER_NAME: deb_agent_builder_amd64, DOCKERFILE_PATH: debs/Debian/7/amd64}, {CONTAINER_NAME: deb_agent_builder_i386, DOCKERFILE_PATH: debs/Debian/7/i386}]
fail-fast: false
steps:
- name: Cancel previous runs
uses: fkirc/skip-duplicate-actions@master
with:
cancel_others: 'true'
github_token: ${{ secrets.GITHUB_TOKEN }}
skip_after_successful_duplicate: 'false'
- uses: actions/checkout@v3
- name: Get changed files
uses: dorny/paths-filter@v2
id: changes
with:
filters: |
i386:
- 'debs/Debian/7/i386/**'
- 'debs/build.sh'
manager_amd64:
- 'debs/Debian/8/amd64/**'
- 'debs/build.sh'
agent_amd64:
- 'debs/Debian/7/amd64/**'
- 'debs/build.sh'
generation_script:
- 'debs/generate_debian_package.sh'
- name: Copy build.sh to Dockerfile path
run:
cp $GITHUB_WORKSPACE/debs/build.sh $GITHUB_WORKSPACE/${{ matrix.image.DOCKERFILE_PATH }}
- name: Set tag as version
run:
if [ "${{ github.event.pull_request.merged }}" == "false" ]; then echo "TAG=${{ github.head_ref }}" >> $GITHUB_ENV; else echo "TAG=$(sed 's/\([0-9]*\.[0-9]*\)\.[0-9]*/\1/' $GITHUB_WORKSPACE/VERSION)" >> $GITHUB_ENV; fi
- name: Build and push image ${{ matrix.image.CONTAINER_NAME }} with tag ${{ env.TAG }} to Github Container Registry
if: (steps.changes.outputs.generation_script == 'true' ) || ( steps.changes.outputs.i386 == 'true' && matrix.image.CONTAINER_NAME == 'deb_agent_builder_i386' ) || ( steps.changes.outputs.manager_amd64 == 'true' && matrix.image.CONTAINER_NAME == 'deb_manager_builder_amd64') || ( steps.changes.outputs.agent_amd64 == 'true' && matrix.image.CONTAINER_NAME == 'deb_agent_builder_amd64' )
run:
bash $GITHUB_WORKSPACE/.github/actions/ghcr-pull-and-push/build_and_push_image_to_ghcr.sh ${{ secrets.GITHUB_TOKEN }} ${{ github.actor}} ${{matrix.image.CONTAINER_NAME}} ${{ matrix.image.DOCKERFILE_PATH }} ${{ env.TAG }}
Build-packages-deb:
needs: Upload-deb-package-building-images
if: github.event_name == 'pull_request'
uses: ./.github/workflows/build-deb-packages.yml
secrets: inherit
Test-packages-deb:
needs: Build-packages-deb
if: github.event_name == 'pull_request'
uses: ./.github/workflows/test-install-deb.yml
secrets: inherit