diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 749c7c9..2f11879 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,5 +1,5 @@ name: Dockerfiles Release -on: [create] +on: create concurrency: group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} cancel-in-progress: true @@ -7,15 +7,29 @@ env: GITHUB_TOKEN: ${{ github.token }} jobs: - release: - if: (github.event_name == 'create' && github.event.ref_type == 'tag') - name: Release + if: (github.event_name == 'create' && github.event.ref_type == 'tag') + release-pre-reqs: + name: Release image required by other images + runs-on: ubuntu-latest + steps: + - name: Code Checkout + uses: actions/checkout@v4 + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and Push + run: ./build-and-push-images.sh os-core ${{ github.event.ref }} + run: ./build-and-push-images.sh httpd ${{ github.event.ref }} + release-matrix: + name: Release Matrix strategy: - fail-fast: false + matrix: + iamge: ['cgit', 'golang', 'haproxy', 'iperf', 'mariadb', 'memcached', 'nginx', 'node', 'numpy-mp', 'perl', 'php', 'php-fpm', 'postgres', 'python', 'rabbitmq', 'r-base', 'redis', 'ruby', 'tesseract-ocr'] runs-on: ubuntu-latest steps: - - name: Delete unused tools folder - run: rm -rf /opt/hostedtoolcache - name: Code Checkout uses: actions/checkout@v4 - name: Login to GitHub Container Registry @@ -25,4 +39,4 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build and Push - run: ./build-and-push-images.sh ${{ github.event.ref }} + run: ./build-and-push-images.sh ${{ matrix.image }} ${{ github.event.ref }} diff --git a/build-and-push-images.sh b/build-and-push-images.sh index dcfda80..074bef5 100755 --- a/build-and-push-images.sh +++ b/build-and-push-images.sh @@ -23,30 +23,4 @@ build_and_push_image() { push_image "${name}" "${ver}" } -main() { - local ver="$1" - build_and_push_image os-core "${ver}" - # httpd is used by cgit so it must be pushed first - build_and_push_image httpd "${ver}" - build_and_push_image cgit "${ver}" - build_and_push_image golang "${ver}" - build_and_push_image haproxy "${ver}" - build_and_push_image iperf "${ver}" - build_and_push_image mariadb "${ver}" - build_and_push_image memcached "${ver}" - build_and_push_image nginx "${ver}" - build_and_push_image node "${ver}" - build_and_push_image numpy-mp "${ver}" - build_and_push_image perl "${ver}" - build_and_push_image php "${ver}" - build_and_push_image php-fpm "${ver}" - build_and_push_image postgres "${ver}" - build_and_push_image python "${ver}" - build_and_push_image rabbitmq "${ver}" - build_and_push_image r-base "${ver}" - build_and_push_image redis "${ver}" - build_and_push_image ruby "${ver}" - build_and_push_image tesseract-ocr "${ver}" -} - -main $1 +build_and_push_image $1 $2