43 lines
1.1 KiB
YAML
43 lines
1.1 KiB
YAML
|
name: Build PHP 7 Image
|
||
|
|
||
|
on:
|
||
|
push:
|
||
|
branches:
|
||
|
- master
|
||
|
|
||
|
jobs:
|
||
|
docker-build:
|
||
|
runs-on: ubuntu-latest
|
||
|
|
||
|
steps:
|
||
|
- name: 🔍 Checkout code
|
||
|
uses: actions/checkout@v2
|
||
|
|
||
|
- name: 🏗️ Set up Docker Buildx
|
||
|
uses: docker/setup-buildx-action@v1
|
||
|
|
||
|
- name: 🔑 Login to DockerHub
|
||
|
uses: docker/login-action@v1
|
||
|
with:
|
||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||
|
|
||
|
- name: 🎃 Set up outputs
|
||
|
id: vars
|
||
|
run: |
|
||
|
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
|
||
|
- name: ⚓ Build and push
|
||
|
uses: docker/build-push-action@v2
|
||
|
with:
|
||
|
context: .
|
||
|
file: ./Dockerfile.php7
|
||
|
pull: true
|
||
|
push: true
|
||
|
# build-args: |
|
||
|
# arg1=value1
|
||
|
# arg2=value2
|
||
|
cache-from: type=registry,ref=mashirozx/php-nginx:php7
|
||
|
cache-to: type=inline
|
||
|
tags: |
|
||
|
mashirozx/php-nginx:php7
|
||
|
mashirozx/php-nginx:php7-${{steps.vars.outputs.sha_short}}
|