158 lines
7.5 KiB
YAML
158 lines
7.5 KiB
YAML
name: Build
|
|
|
|
on:
|
|
push:
|
|
schedule:
|
|
- cron: '0 4 * * TUE'
|
|
|
|
jobs:
|
|
|
|
lint:
|
|
name: Lint docker files
|
|
runs-on: ubuntu-20.04
|
|
if: "!contains(github.event.head_commit.message, 'ci skip')"
|
|
steps:
|
|
- uses: actions/checkout@master
|
|
- uses: brpaz/hadolint-action@master
|
|
|
|
build-marshall:
|
|
needs: [lint]
|
|
runs-on: ubuntu-20.04
|
|
if: "!contains(github.event.head_commit.message, 'ci skip')"
|
|
steps:
|
|
- uses: actions/checkout@v1
|
|
- uses: docker/setup-qemu-action@v1
|
|
name: Setup QEmu
|
|
- uses: docker/setup-buildx-action@v1
|
|
name: Setup Docker Buildx
|
|
- 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: .
|
|
target: marshall
|
|
platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
tags: gone/marshall
|
|
|
|
build-php:
|
|
needs: [lint]
|
|
runs-on: ubuntu-20.04
|
|
if: "!contains(github.event.head_commit.message, 'ci skip')"
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
variant:
|
|
- cli
|
|
- nginx
|
|
- apache
|
|
onbuild:
|
|
- ''
|
|
# - '-onbuild'
|
|
version:
|
|
#- "5.6"
|
|
#- "7.0"
|
|
#- "7.1"
|
|
#- "7.2"
|
|
- "7.3"
|
|
- "7.4"
|
|
- "8.0"
|
|
env:
|
|
#PHP_PACKAGES_56: git mariadb-client php-xdebug php5.6-apcu php5.6-bcmath php5.6-bz2 php5.6-cli php5.6-curl php5.6-gd php5.6-imap php5.6-imagick php5.6-intl php5.6-json php5.6-ldap php5.6-mbstring php5.6-mcrypt php5.6-memcache php5.6-memcached php5.6-mysql php5.6-opcache php5.6-pgsql php5.6-phpdbg php5.6-pspell php5.6-redis php5.6-soap php5.6-sqlite php5.6-xdebug php5.6-xml php5.6-zip postgresql-client
|
|
PHP_PACKAGES_70: git mariadb-client php-xdebug 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 php-xdebug 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 php-xdebug 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 php-xdebug 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 php-xdebug 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 php-xdebug 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 }}`
|
|
- uses: actions/checkout@v1
|
|
- uses: docker/setup-qemu-action@v1
|
|
name: Setup QEmu
|
|
- uses: docker/setup-buildx-action@v1
|
|
name: Setup Docker Buildx
|
|
- 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-
|
|
- 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: .
|
|
target: php-${{ matrix.variant }}
|
|
platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
tags: gone/php:${{ matrix.variant }}-${{ matrix.version }}${{ matrix.onbuild }}
|
|
build-args: |
|
|
${{ steps.build_args.outputs.result }}
|
|
cache-from: type=local,src=/tmp/.buildx-cache
|
|
cache-to: type=local,dest=/tmp/.buildx-cache
|
|
|
|
vanity-tags:
|
|
needs: [ build-php ]
|
|
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 gone/php:${{ matrix.variant }}-${{ env.latest-stable-version }} to gone/php:${{ matrix.variant }}
|
|
run: |
|
|
docker pull gone/php:${{ matrix.variant }}-${{ env.latest-stable-version }}
|
|
docker tag gone/php:${{ matrix.variant }}-${{ env.latest-stable-version }} gone/php:${{ matrix.variant }}
|
|
docker push gone/php:${{ matrix.variant }}
|
|
|