31
31
is_release : ${{ steps.build_details.outputs.is_release }}
32
32
is_rolling_release : ${{ steps.build_details.outputs.is_rolling_release }}
33
33
is_fork : ${{ steps.build_details.outputs.is_fork }}
34
+ publish_docker_image : ${{ steps.build_details.outputs.is_fork != 'true' && github.event_name != 'merge_group' }}
34
35
build_os : ${{ steps.build_details.outputs.build_os }}
35
36
build_platform : ${{ steps.build_details.outputs.build_platform }}
36
37
build_include : ${{ steps.build_details.outputs.build_include }}
@@ -615,7 +616,6 @@ jobs:
615
616
build_docker :
616
617
runs-on : ${{ matrix.runs-on }}
617
618
needs : [build_details, build_posix, fetch_s3_artifacts]
618
- if : needs.build_details.outputs.is_fork != 'true' && github.event_name != 'merge_group'
619
619
strategy :
620
620
fail-fast : false
621
621
matrix :
@@ -638,15 +638,36 @@ jobs:
638
638
run : |
639
639
echo "deb-file=$(find artifacts/${{ needs.build_details.outputs.sha }} -type f | grep ${{ matrix.docker-debian-os }} | grep -v minimal | grep '${{ matrix.platform }}\.deb$' | grep dbgsym | grep deb)" >> "${GITHUB_OUTPUT}"
640
640
id : debian_debug_package
641
- - name : Log in to the github registry
642
- run : echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
643
- - name : Build docker image
644
- run : .github/scripts/build-docker.sh ${{ steps.debian_package.outputs.deb-file }} ${{ steps.debian_debug_package.outputs.deb-file }} ${{ needs.build_details.outputs.branch }} ${{ secrets.DOCKERHUB_USER }} ${{ secrets.DOCKERHUB_PASSWORD }} ${{ matrix.platform }}
641
+ - name : Login to Docker Hub
642
+ if : needs.build_details.outputs.publish_docker_image == 'true'
643
+ uses : docker/login-action@v3
644
+ with :
645
+ username : ${{ secrets.DOCKERHUB_USER }}
646
+ password : ${{ secrets.DOCKERHUB_PASSWORD }}
647
+ - name : Login to GitHub Container Registry
648
+ if : needs.build_details.outputs.publish_docker_image == 'true'
649
+ uses : docker/login-action@v3
650
+ with :
651
+ registry : ghcr.io
652
+ username : ${{ github.actor }}
653
+ password : ${{ secrets.GITHUB_TOKEN }}
654
+ - name : Build and push docker image
655
+ uses : docker/build-push-action@v6
656
+ with :
657
+ build-args : |
658
+ "DEB_FILE=${{ steps.debian_package.outputs.deb-file }}"
659
+ "DEB_DEBUG_FILE=${{ steps.debian_debug_package.outputs.deb-file }}"
660
+ context : .
661
+ file : .github/docker/debian.dockerfile
662
+ tags : |
663
+ "savonet/liquidsoap-ci-build:${{ needs.build_details.outputs.branch }}_${{ matrix.platform }}"
664
+ "ghcr.io/savonet/liquidsoap-ci-build:${{ needs.build_details.outputs.branch }}_${{ matrix.platform }}"
665
+ push : ${{ needs.build_details.outputs.publish_docker_image }}
645
666
646
667
build_docker_alpine :
647
668
runs-on : ${{ matrix.runs-on }}
648
- needs : [build_details, run_tests, build_posix, fetch_s3_artifacts]
649
- if : needs.build_details.outputs.is_fork != 'true' && github.event_name != 'merge_group'
669
+ needs : [build_details, build_posix, fetch_s3_artifacts]
670
+ if : needs.build_details.outputs.is_fork != 'true'
650
671
strategy :
651
672
fail-fast : false
652
673
matrix :
@@ -665,15 +686,34 @@ jobs:
665
686
run : |
666
687
echo "apk-file=$(find artifacts/${{ needs.build_details.outputs.sha }} -type f | grep -v minimal | grep 'apk$' | grep -v dbg | grep ${{ matrix.alpine-arch }})" >> "${GITHUB_OUTPUT}"
667
688
id : alpine_package
668
- - name : Log in to the github registry
669
- run : echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
670
- - name : Build docker image
671
- run : .github/scripts/build-docker-alpine.sh ${{ steps.alpine_package.outputs.apk-file }} ${{ needs.build_details.outputs.branch }} ${{ secrets.DOCKERHUB_USER }} ${{ secrets.DOCKERHUB_PASSWORD }} ${{ matrix.platform }}
689
+ - name : Login to Docker Hub
690
+ if : needs.build_details.outputs.publish_docker_image == 'true'
691
+ uses : docker/login-action@v3
692
+ with :
693
+ username : ${{ secrets.DOCKERHUB_USER }}
694
+ password : ${{ secrets.DOCKERHUB_PASSWORD }}
695
+ - name : Login to GitHub Container Registry
696
+ if : needs.build_details.outputs.publish_docker_image == 'true'
697
+ uses : docker/login-action@v3
698
+ with :
699
+ registry : ghcr.io
700
+ username : ${{ github.actor }}
701
+ password : ${{ secrets.GITHUB_TOKEN }}
702
+ - name : Build and push docker image
703
+ uses : docker/build-push-action@v6
704
+ with :
705
+ build-args : |
706
+ "APK_FILE=${{ steps.alpine_package.outputs.apk-file }}"
707
+ context : .
708
+ file : .github/docker/alpine.dockerfile
709
+ tags : |
710
+ "savonet/liquidsoap-ci-build:${{ needs.build_details.outputs.branch }}_alpine_${{ matrix.platform }}"
711
+ "ghcr.io/savonet/liquidsoap-ci-build:${{ needs.build_details.outputs.branch }}_alpine_${{ matrix.platform }}"
712
+ push : ${{ needs.build_details.outputs.publish_docker_image }}
672
713
673
714
build_docker_minimal :
674
715
runs-on : ${{ matrix.runs-on }}
675
- needs : [build_details, run_tests, build_posix, fetch_s3_artifacts]
676
- if : needs.build_details.outputs.is_fork != 'true' && github.event_name != 'merge_group'
716
+ needs : [build_details, build_posix, fetch_s3_artifacts]
677
717
strategy :
678
718
fail-fast : false
679
719
matrix :
@@ -696,15 +736,36 @@ jobs:
696
736
run : |
697
737
echo "deb-file=$(find artifacts/${{ needs.build_details.outputs.sha }} -type f | grep ${{ matrix.docker-debian-os }} | grep minimal | grep '${{ matrix.platform }}\.deb$' | grep dbgsym | grep deb)" >> "${GITHUB_OUTPUT}"
698
738
id : debian_debug_package
699
- - name : Log in to the github registry
700
- run : echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
701
- - name : Build docker image
702
- run : .github/scripts/build-docker.sh ${{ steps.debian_package.outputs.deb-file }} ${{ steps.debian_debug_package.outputs.deb-file }} ${{ needs.build_details.outputs.branch }}-minimal ${{ secrets.DOCKERHUB_USER }} ${{ secrets.DOCKERHUB_PASSWORD }} ${{ matrix.platform }}
739
+ - name : Login to Docker Hub
740
+ if : needs.build_details.outputs.publish_docker_image == 'true'
741
+ uses : docker/login-action@v3
742
+ with :
743
+ username : ${{ secrets.DOCKERHUB_USER }}
744
+ password : ${{ secrets.DOCKERHUB_PASSWORD }}
745
+ - name : Login to GitHub Container Registry
746
+ if : needs.build_details.outputs.publish_docker_image == 'true'
747
+ uses : docker/login-action@v3
748
+ with :
749
+ registry : ghcr.io
750
+ username : ${{ github.actor }}
751
+ password : ${{ secrets.GITHUB_TOKEN }}
752
+ - name : Build and push docker image
753
+ uses : docker/build-push-action@v6
754
+ with :
755
+ build-args : |
756
+ "DEB_FILE=${{ steps.debian_package.outputs.deb-file }}"
757
+ "DEB_DEBUG_FILE=${{ steps.debian_debug_package.outputs.deb-file }}"
758
+ context : .
759
+ file : .github/docker/debian.dockerfile
760
+ tags : |
761
+ "savonet/liquidsoap-ci-build:${{ needs.build_details.outputs.branch }}-minimal_${{ matrix.platform }}"
762
+ "ghcr.io/savonet/liquidsoap-ci-build:${{ needs.build_details.outputs.branch }}-minimal_${{ matrix.platform }}"
763
+ push : ${{ needs.build_details.outputs.publish_docker_image }}
703
764
704
765
build_docker_alpine_minimal :
705
766
runs-on : ${{ matrix.runs-on }}
706
- needs : [build_details, run_tests, build_posix, fetch_s3_artifacts]
707
- if : needs.build_details.outputs.is_fork != 'true' && github.event_name != 'merge_group'
767
+ needs : [build_details, build_posix, fetch_s3_artifacts]
768
+ if : needs.build_details.outputs.is_fork != 'true'
708
769
strategy :
709
770
fail-fast : false
710
771
matrix :
@@ -723,14 +784,30 @@ jobs:
723
784
run : |
724
785
echo "apk-file=$(find artifacts/${{ needs.build_details.outputs.sha }} -type f | grep minimal | grep 'apk$' | grep -v dbg | grep ${{ matrix.alpine-arch }})" >> "${GITHUB_OUTPUT}"
725
786
id : alpine_package
726
- - name : Get alpine debug package
727
- run : |
728
- echo "apk-file=$(find artifacts/${{ needs.build_details.outputs.sha }} -type f | grep minimal | grep 'apk$' | grep dbg | grep ${{ matrix.alpine-arch }})" >> "${GITHUB_OUTPUT}"
729
- id : alpine_dbg_package
730
- - name : Log in to the github registry
731
- run : echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
732
- - name : Build docker image
733
- run : .github/scripts/build-docker-alpine.sh ${{ steps.alpine_package.outputs.apk-file }} ${{ steps.alpine_dbg_package.outputs.apk-file }} ${{ needs.build_details.outputs.branch }}-minimal ${{ secrets.DOCKERHUB_USER }} ${{ secrets.DOCKERHUB_PASSWORD }} ${{ matrix.platform }}
787
+ - name : Login to Docker Hub
788
+ if : needs.build_details.outputs.publish_docker_image == 'true'
789
+ uses : docker/login-action@v3
790
+ with :
791
+ username : ${{ secrets.DOCKERHUB_USER }}
792
+ password : ${{ secrets.DOCKERHUB_PASSWORD }}
793
+ - name : Login to GitHub Container Registry
794
+ if : needs.build_details.outputs.publish_docker_image == 'true'
795
+ uses : docker/login-action@v3
796
+ with :
797
+ registry : ghcr.io
798
+ username : ${{ github.actor }}
799
+ password : ${{ secrets.GITHUB_TOKEN }}
800
+ - name : Build and push docker image
801
+ uses : docker/build-push-action@v6
802
+ with :
803
+ build-args : |
804
+ "APK_FILE=${{ steps.alpine_package.outputs.apk-file }}"
805
+ context : .
806
+ file : .github/docker/alpine.dockerfile
807
+ tags : |
808
+ "savonet/liquidsoap-ci-build:${{ needs.build_details.outputs.branch }}-minimal_alpine_${{ matrix.platform }}"
809
+ "ghcr.io/savonet/liquidsoap-ci-build:${{ needs.build_details.outputs.branch }}-minimal_alpine_${{ matrix.platform }}"
810
+ push : ${{ needs.build_details.outputs.publish_docker_image }}
734
811
735
812
build_docker_release :
736
813
runs-on : ubuntu-latest
0 commit comments