Skip to content

Merge pull request #40 from cron-eu/php-env #49

Merge pull request #40 from cron-eu/php-env

Merge pull request #40 from cron-eu/php-env #49

name: "Deploy Image to DockerHub"
on:
workflow_dispatch:
push:
branches:
- master
env:
PLATFORMS: linux/arm64/v8,linux/amd64
jobs:
build_fpm:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- php-version: "8.2"
- php-version: "8.1"
- php-version: "7.4"
steps:
- name: "Checkout Sourcecode"
uses: actions/checkout@v3
- name: "Set up Docker Buildx"
id: builder
uses: docker/setup-buildx-action@v2
- name: "Append ARM buildx builder from AWS"
uses: baschny/append-buildx-action@v1
with:
builder: ${{ steps.builder.outputs.name }}
node_name: arm-${{ matrix.php-version }}-${{ matrix.node-version }}-${{ github.sha }}
endpoint: "ssh://[email protected]"
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: "Login to DockerHub"
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: "Docker build and push (fpm image)"
uses: docker/build-push-action@v4
with:
tags: "croneu/phpapp-fpm:php-${{ matrix.php-version }}"
platforms: ${{ env.PLATFORMS }}
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
target: php-fpm
build-args: |
PHP_MINOR_VERSION=${{ matrix.php-version }}
- name: "Update Docker Hub Description (croneu/phpapp-fpm)"
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: croneu/phpapp-fpm
short-description: ${{ github.event.repository.description }} - PHP-FPM
build_ssh:
needs:
- build_fpm
runs-on: ubuntu-latest
strategy:
matrix:
include:
- php-version: "8.2"
node-version: "18"
- php-version: "8.1"
node-version: "16"
- php-version: "7.4"
node-version: "16"
- php-version: "7.4"
node-version: "14"
- php-version: "7.4"
node-version: "12"
- php-version: "7.4"
node-version: "10"
steps:
- name: "Checkout Sourcecode"
uses: actions/checkout@v3
- name: "Set up Docker Buildx"
id: builder
uses: docker/setup-buildx-action@v2
- name: "Append ARM buildx builder from AWS"
uses: baschny/append-buildx-action@v1
with:
builder: ${{ steps.builder.outputs.name }}
node_name: arm-${{ matrix.php-version }}-${{ matrix.node-version }}-${{ github.sha }}
endpoint: "ssh://[email protected]"
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: "Login to DockerHub"
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: "Docker build and push (ssh image)"
uses: docker/build-push-action@v4
with:
tags: "croneu/phpapp-ssh:php-${{ matrix.php-version }}-node-${{ matrix.node-version }}"
platforms: ${{ env.PLATFORMS }}
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
target: ssh
build-args: |
PHP_MINOR_VERSION=${{ matrix.php-version }}
NODE_VERSION=${{ matrix.node-version }}
- name: "Update Docker Hub Description (croneu/phpapp-ssh)"
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: croneu/phpapp-ssh
short-description: ${{ github.event.repository.description }} - SSH