-
Notifications
You must be signed in to change notification settings - Fork 99
70 lines (62 loc) · 2.87 KB
/
upload-deb-images.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
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