Skip to content

Build Docker PHP 8.3 App Non-Root (Alpine) #4

Build Docker PHP 8.3 App Non-Root (Alpine)

Build Docker PHP 8.3 App Non-Root (Alpine) #4

name: Build Docker PHP 8.3 App Non-Root (Alpine)
env:
OS_VARIANT: alpine
PHP_VERSION: '8.3'
on:
push:
branches:
- master
paths:
- .github/workflows/build-8.3-alpine.yml
- build/
- Dockerfile
schedule:
- cron: 42 23 * * 6
workflow_dispatch:
jobs:
build-docker:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: frxyt/php-app-non-root
tags: |
type=raw,value=${{ env.PHP_VERSION }}-${{ env.OS_VARIANT }}-${{ github.sha }}-${{ steps.date.outputs.date }}
type=raw,value=${{ env.PHP_VERSION }}-${{ env.OS_VARIANT }}-${{ github.sha }}
type=raw,value=${{ env.PHP_VERSION }}-${{ env.OS_VARIANT }}
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push - frxyt/php-app-non-root
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
build-args: |
FRX_BUILD_COMMIT_DATE=${{ steps.date.outputs.date }}
FRX_BUILD_COMMIT_SHA=${{ github.sha}}
FRX_OS_VARIANT=${{ env.OS_VARIANT }}
FRX_PHP_VERSION=${{ env.PHP_VERSION }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}