Skip to content

Build and Push PHP ACTUAL #68

Build and Push PHP ACTUAL

Build and Push PHP ACTUAL #68

Workflow file for this run

name: Build and Push PHP ACTUAL
on:
schedule:
- cron: '0 0 * * *' # Spustí denní build každý den v 00:00 UTC
workflow_dispatch: # Umožní manuální spuštění z GitHub UI
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to Docker Hub
run: echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin
- name: Build and Push Docker Images to Docker Hub
run: |
for version in 7.4 8.2 8.3 8.3-fpm-nginx; do
docker build -t massimofilippi/php:$version ./$version
docker push massimofilippi/php:$version
done
- name: Notify Slack of build status
if: success()
run: |
curl -X POST -H 'Content-type: application/json' --data '{"text":"Docker images build and push succeeded for all PHP versions!"}' ${{ secrets.SLACK_WEBHOOK_URL }}
- name: Notify Slack of build failure
if: failure()
run: |
curl -X POST -H 'Content-type: application/json' --data '{"text":"Docker images build or push failed for one or more PHP versions!"}' ${{ secrets.SLACK_WEBHOOK_URL }}