diff --git a/.github/workflows/build-images.yml b/.github/workflows/build-images.yml index 4fef474..f944a21 100644 --- a/.github/workflows/build-images.yml +++ b/.github/workflows/build-images.yml @@ -1,4 +1,4 @@ -name: Deploy multi-architecture Docker images for privatebin with buildx +name: Build & Deploy container image on: schedule: @@ -15,8 +15,9 @@ jobs: strategy: fail-fast: false matrix: - image: [stable, edge] - name: Build images based on ${{ matrix.image }} Alpine release + base-image: [stable, edge] + destination-image: [nginx-fpm-alpine, fs, pdo, gcs] + name: ${{ matrix.destination-image }} image / ${{ matrix.base-image }} release steps: - name: Checkout uses: actions/checkout@v2 @@ -32,4 +33,4 @@ jobs: env: DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - run: ./buildx.sh ${{ github.event_name }} ${{ matrix.image }} + run: ./buildx.sh ${{ github.event_name }} ${{ matrix.destination-image }} ${{ matrix.base-image }} diff --git a/buildx.sh b/buildx.sh index 5f722e5..6da2ae1 100755 --- a/buildx.sh +++ b/buildx.sh @@ -5,8 +5,9 @@ set -euxo pipefail EVENT=$1 +IMAGE=$2 EDGE=false -[ "$2" = edge ] && EDGE=true +[ "$3" = edge ] && EDGE=true build_image() { local PUSH @@ -29,15 +30,6 @@ docker_login() { --password-stdin } -image_build_arguments() { - cat< Dockerfile.edge + build_image $PUSH -f Dockerfile.edge --tag "$IMAGE:edge" "$BUILD_ARGS" fi - image_build_arguments | while read -r IMAGE BUILD_ARGS ; do - if [ "$EDGE" = false ] ; then - build_image $PUSH --tag "$IMAGE:latest" --tag "$IMAGE:$TAG" --tag "${IMAGE}:${TAG%%-*}" "$BUILD_ARGS" - else - build_image $PUSH -f Dockerfile.edge --tag "$IMAGE:edge" "$BUILD_ARGS" - fi - done rm -f Dockerfile.edge "$HOME/.docker/config.json" }