name: Build on: push: schedule: - cron: '0 4 * * TUE' jobs: lint: name: Lint docker files runs-on: ubuntu-20.04 strategy: fail-fast: false matrix: dockerfile: - marshall/Dockerfile - php/Dockerfile.Core - php/Dockerfile.Flavours - node/Dockerfile - mariadb/Dockerfile - redis/Dockerfile - octoprint/Dockerfile steps: - uses: actions/checkout@master - uses: brpaz/hadolint-action@master with: dockerfile: ${{ matrix.dockerfile }} marshall-build: name: "Build Marshall" needs: [ lint ] runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v1 - uses: docker/setup-qemu-action@v1 - uses: docker/setup-buildx-action@v1 - uses: docker/login-action@v1 name: Login to Docker Hub with: username: ${{ secrets.DOCKER_HUB_USERNAME }} password: ${{ secrets.DOCKER_HUB_PASSWORD }} - uses: docker/login-action@v1 name: Login to Github Container Registry with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GHCR_PAT }} - name: Setup Marshall run: | git rev-parse --short HEAD > marshall/marshall_version date '+%Y-%m-%d %H:%M:%S' > marshall/marshall_build_date hostname > marshall/marshall_build_host - uses: docker/build-push-action@v2 name: Build & Push with: context: marshall platforms: linux/amd64,linux/arm64 pull: true push: true tags: | benzine/marshall:latest php-build-core: name: "Build PHP Core" needs: [ lint, marshall-build ] runs-on: ubuntu-20.04 strategy: fail-fast: false matrix: version: #- "7.0" #- "7.1" #- "7.2" - "7.3" - "7.4" - "8.0" env: PHP_PACKAGES_70: git mariadb-client php7.0-apcu php7.0-bcmath php7.0-bz2 php7.0-cli php7.0-curl php7.0-gd php7.0-imap php7.0-imagick php7.0-intl php7.0-json php7.0-ldap php7.0-mbstring php7.0-mcrypt php7.0-memcache php7.0-memcached php7.0-mongodb php7.0-mysql php7.0-opcache php7.0-pgsql php7.0-phpdbg php7.0-pspell php7.0-redis php7.0-soap php7.0-sqlite php7.0-xdebug php7.0-xml php7.0-zip postgresql-client PHP_PACKAGES_71: git mariadb-client php7.1-apcu php7.1-bcmath php7.1-bz2 php7.1-cli php7.1-curl php7.1-gd php7.1-imap php7.1-imagick php7.1-intl php7.1-json php7.1-ldap php7.1-mbstring php7.1-mcrypt php7.1-memcache php7.1-memcached php7.1-mongodb php7.1-mysql php7.1-opcache php7.1-pgsql php7.1-phpdbg php7.1-pspell php7.1-redis php7.1-soap php7.1-sqlite php7.1-xdebug php7.1-xml php7.1-zip postgresql-client PHP_PACKAGES_72: git mariadb-client php7.2-apcu php7.2-bcmath php7.2-bz2 php7.2-cli php7.2-curl php7.2-gd php7.2-imap php7.2-imagick php7.2-intl php7.2-json php7.2-ldap php7.2-mbstring php7.2-memcache php7.2-memcached php7.2-mongodb php7.2-mysql php7.2-opcache php7.2-pgsql php7.2-phpdbg php7.2-pspell php7.2-redis php7.2-soap php7.2-sqlite php7.2-xdebug php7.2-xml php7.2-zip postgresql-client PHP_PACKAGES_73: git mariadb-client php7.3-apcu php7.3-bcmath php7.3-bz2 php7.3-cli php7.3-curl php7.3-gd php7.3-imap php7.3-imagick php7.3-intl php7.3-json php7.3-ldap php7.3-mbstring php7.3-memcache php7.3-memcached php7.3-mongodb php7.3-mysql php7.3-opcache php7.3-pgsql php7.3-phpdbg php7.3-pspell php7.3-redis php7.3-soap php7.3-sqlite php7.3-xdebug php7.3-xml php7.3-zip postgresql-client PHP_PACKAGES_74: git mariadb-client php7.4-apcu php7.4-bcmath php7.4-bz2 php7.4-cli php7.4-curl php7.4-gd php7.4-imap php7.4-imagick php7.4-intl php7.4-json php7.4-ldap php7.4-mbstring php7.4-memcache php7.4-mongodb php7.4-mysql php7.4-opcache php7.4-pgsql php7.4-phpdbg php7.4-pspell php7.4-redis php7.4-soap php7.4-sqlite php7.4-xdebug php7.4-xml php7.4-zip postgresql-client PHP_PACKAGES_80: git mariadb-client php8.0-apcu php8.0-bcmath php8.0-bz2 php8.0-cli php8.0-curl php8.0-gd php8.0-imap php8.0-imagick php8.0-intl php8.0-ldap php8.0-mbstring php8.0-memcache php8.0-mysql php8.0-opcache php8.0-pgsql php8.0-phpdbg php8.0-pspell php8.0-redis php8.0-soap php8.0-sqlite php8.0-xdebug php8.0-xml php8.0-zip postgresql-client steps: - name: Mangle Envs id: vars run: | VERSION=$(echo "${{ matrix.version }}" | tr -d '.') PACKAGE_LIST=PHP_PACKAGES_$VERSION echo ::set-output name=php_packages::${!PACKAGE_LIST} - name: Show mangled envs run: | echo "Packages to be installed:" echo ${{ steps.vars.outputs.php_packages }} - uses: actions/github-script@v3 name: Build Args id: build_args with: result-encoding: string script: return `PHP_PACKAGES=${{ steps.vars.outputs.php_packages }}\nPHP_VERSION=${{ matrix.version }}\nPHP_CORE_VERSION=benzine/php:core-${{ matrix.version }}` - uses: actions/checkout@v1 - uses: docker/setup-qemu-action@v1 - uses: docker/setup-buildx-action@v1 - uses: docker/login-action@v1 name: Login to Docker Hub with: username: ${{ secrets.DOCKER_HUB_USERNAME }} password: ${{ secrets.DOCKER_HUB_PASSWORD }} - name: Cache Docker layers uses: actions/cache@v2 with: path: /tmp/.buildx-cache key: ${{ runner.os }}-buildx-${{ github.sha }} restore-keys: | ${{ runner.os }}-buildx- - uses: docker/build-push-action@v2 name: Build & Push with: context: php file: php/Dockerfile.Core target: php-core platforms: linux/amd64,linux/arm64 pull: true push: true tags: | benzine/php:core-${{ matrix.version }} build-args: | ${{ steps.build_args.outputs.result }} cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache php-build-flavours: name: "Build PHP Flavours" needs: [ php-build-core ] runs-on: ubuntu-20.04 strategy: fail-fast: false matrix: variant: - cli - nginx - apache version: #- "7.0" #- "7.1" #- "7.2" - "7.3" - "7.4" - "8.0" steps: - name: Mangle Envs id: vars run: | VERSION=$(echo "${{ matrix.version }}" | tr -d '.') PACKAGE_LIST=PHP_PACKAGES_$VERSION echo ::set-output name=php_packages::${!PACKAGE_LIST} - name: Show mangled envs run: | echo "Packages to be installed:" echo ${{ steps.vars.outputs.php_packages }} - uses: actions/github-script@v3 name: Build Args id: build_args with: result-encoding: string script: return `PHP_VERSION=${{ matrix.version }}\nPHP_CORE_VERSION=benzine/php:core-${{ matrix.version }}` - uses: actions/checkout@v1 - uses: docker/setup-qemu-action@v1 - uses: docker/setup-buildx-action@v1 - uses: docker/login-action@v1 name: Login to Docker Hub with: username: ${{ secrets.DOCKER_HUB_USERNAME }} password: ${{ secrets.DOCKER_HUB_PASSWORD }} - name: Cache Docker layers uses: actions/cache@v2 with: path: /tmp/.buildx-cache key: ${{ runner.os }}-buildx-${{ github.sha }} restore-keys: | ${{ runner.os }}-buildx- - uses: docker/build-push-action@v2 name: Build & Push with: context: php file: php/Dockerfile.Flavours target: php-${{ matrix.variant }} platforms: linux/amd64,linux/arm64 pull: true push: true tags: | benzine/php:${{ matrix.variant }}-${{ matrix.version }} build-args: | ${{ steps.build_args.outputs.result }} cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache php-vanity-tags: name: Vanity Tags needs: [ php-build-flavours ] runs-on: ubuntu-20.04 env: latest-stable-version: "7.4" strategy: fail-fast: false matrix: variant: - cli - nginx - apache steps: - uses: docker/login-action@v1 name: Login to Docker Hub with: username: ${{ secrets.DOCKER_HUB_USERNAME }} password: ${{ secrets.DOCKER_HUB_PASSWORD }} - name: Retag benzine/php:${{ matrix.variant }}-${{ env.latest-stable-version }} to benzine/php:${{ matrix.variant }} run: | docker pull benzine/php:${{ matrix.variant }}-${{ env.latest-stable-version }} docker tag benzine/php:${{ matrix.variant }}-${{ env.latest-stable-version }} benzine/php:${{ matrix.variant }} docker push benzine/php:${{ matrix.variant }} docker tag benzine/php:${{ matrix.variant }}-${{ env.latest-stable-version }} gone/php:${{ matrix.variant }}-${{ env.latest-stable-version }} docker push gone/php:${{ matrix.variant }}-${{ env.latest-stable-version }} docker tag benzine/php:${{ matrix.variant }}-${{ env.latest-stable-version }} gone/php:${{ matrix.variant }} docker push gone/php:${{ matrix.variant }} mariadb-build: name: "MariaDB with Healthchecks" runs-on: ubuntu-20.04 needs: [ lint ] steps: - uses: actions/checkout@v1 - uses: docker/setup-qemu-action@v1 - uses: docker/setup-buildx-action@v1 - uses: docker/login-action@v1 name: Login to Docker Hub with: username: ${{ secrets.DOCKER_HUB_USERNAME }} password: ${{ secrets.DOCKER_HUB_PASSWORD }} - uses: docker/build-push-action@v2 name: Build & Push with: context: mariadb platforms: linux/amd64,linux/arm64 pull: true push: true tags: | benzine/mariadb redis-build: name: "Redis with Healthchecks" runs-on: ubuntu-20.04 needs: [ lint ] steps: - uses: actions/checkout@v1 - uses: docker/setup-qemu-action@v1 - uses: docker/setup-buildx-action@v1 - uses: docker/login-action@v1 name: Login to Docker Hub with: username: ${{ secrets.DOCKER_HUB_USERNAME }} password: ${{ secrets.DOCKER_HUB_PASSWORD }} - uses: docker/build-push-action@v2 name: Build & Push with: context: redis platforms: linux/amd64,linux/arm64 pull: true push: true tags: | benzine/redis wordpress-build: name: "Bake Wordpress Container" runs-on: ubuntu-20.04 needs: [ lint, php-build-flavours ] steps: - uses: actions/checkout@v1 - uses: docker/setup-qemu-action@v1 - uses: docker/setup-buildx-action@v1 - uses: docker/login-action@v1 name: Login to Docker Hub with: username: ${{ secrets.DOCKER_HUB_USERNAME }} password: ${{ secrets.DOCKER_HUB_PASSWORD }} - uses: docker/build-push-action@v2 name: Build & Push with: context: wordpress platforms: linux/amd64,linux/arm64 pull: true push: true tags: | matthewbaggett/wordpress octoprint-build: name: "Bake Octoprint" runs-on: ubuntu-20.04 needs: [ lint ] steps: - uses: actions/checkout@v1 - uses: docker/setup-qemu-action@v1 - uses: docker/setup-buildx-action@v1 - uses: docker/login-action@v1 name: Login to Docker Hub with: username: ${{ secrets.DOCKER_HUB_USERNAME }} password: ${{ secrets.DOCKER_HUB_PASSWORD }} - uses: docker/build-push-action@v2 name: Build Octoprint with: context: octoprint target: octoprint platforms: linux/amd64,linux/arm64 pull: true push: true tags: matthewbaggett/octoprint:latest - uses: docker/build-push-action@v2 name: Build Octoprint MJPG Streamer Variant with: context: octoprint target: octoprint-mjpg-streamer platforms: linux/amd64,linux/arm64 pull: true push: true tags: matthewbaggett/octoprint:mjpg-streamer-yu12