composer-and-node-ci/.github/workflows/ci.yml

63 wiersze
1.6 KiB
YAML
Czysty Zwykły widok Historia

2021-09-13 17:08:56 +00:00
name: Build and publish
on:
push:
branches:
- master
- main
workflow_dispatch:
jobs:
build_latest:
2021-09-13 17:08:56 +00:00
runs-on: ubuntu-latest
strategy:
matrix:
2023-10-18 13:08:41 +00:00
tag: [php8, php7.4, php7.1]
2022-10-04 08:33:17 +00:00
image: [carlosalgms/composer-and-node-ci]
2022-10-04 08:46:29 +00:00
latest: [php8]
include:
- tag: php8
2022-10-04 08:33:17 +00:00
buildArgs: ""
2023-10-18 13:08:41 +00:00
- tag: php7.4
buildArgs: |
PHP_VERSION=7.4
- tag: php7.1
buildArgs: |
PHP_VERSION=7.1
DEPLOYER_VERSION=v6.6.0
2023-08-27 16:55:13 +00:00
COMPOSER_VERSION=2.2.21
2022-10-04 08:33:17 +00:00
env:
TAGGED_IMAGE: ${{ matrix.image }}:${{ matrix.tag }}
2022-10-04 08:46:29 +00:00
TAGS: ${{ matrix.tag == matrix.latest && format('{0}:latest,', matrix.image) || '' }}${{ matrix.image }}:${{ matrix.tag }}
2021-09-13 17:08:56 +00:00
steps:
2023-10-18 13:08:41 +00:00
- uses: actions/checkout@v4
2021-09-13 17:08:56 +00:00
- name: Set up QEMU
2023-10-18 13:08:41 +00:00
uses: docker/setup-qemu-action@v3
2022-10-04 05:23:11 +00:00
- name: Set up Docker Buildx
2023-10-18 13:08:41 +00:00
uses: docker/setup-buildx-action@v3
2022-10-04 05:23:11 +00:00
2021-09-13 17:08:56 +00:00
- name: Login to Docker Hub
id: docker_login
2023-10-18 13:08:41 +00:00
uses: docker/login-action@v3
2021-09-13 17:08:56 +00:00
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v3
2021-09-13 17:08:56 +00:00
with:
2022-10-04 05:23:11 +00:00
context: .
pull: true
2021-09-13 17:08:56 +00:00
push: true
platforms: linux/amd64,linux/arm64
# platforms: linux/amd64,linux/arm64,linux/arm/v7
2022-10-04 08:33:17 +00:00
cache-from: ${{ env.TAGGED_IMAGE }}
cache-to: type=inline
build-args: ${{ matrix.buildArgs }}
2022-10-04 08:33:17 +00:00
tags: ${{ env.TAGS }}