Skip to content

Commit

Permalink
add missing steps, test without pushing
Browse files Browse the repository at this point in the history
  • Loading branch information
geschke committed Sep 30, 2024
1 parent 3627f79 commit 3897d83
Showing 1 changed file with 38 additions and 12 deletions.
50 changes: 38 additions & 12 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@ on:
branches:
- main

env:
# Use GitHub Container Repository
REGISTRY_GITHUB: ghcr.io

# Use docker.io for Docker Hub if empty
REGISTRY_DOCKER_HUB: docker.io

# github.repository as <account>/<repo>
IMAGE_NAME: geschke/php-fpm-swrm
# was: ${{ github.repository }}
# GitHub repository is named as "docker-<image_name>" to differ Docker images from other contents


jobs:
build-and-push-image:
runs-on: ubuntu-latest
Expand All @@ -14,10 +27,8 @@ jobs:
include:
- directory: ./ubuntu-22.04/
tagging: 8.1-fpm
image: geschke/php-fpm-swrm
- directory: ./ubuntu-22.04-sury-8.2/
tagging: 8.2-fpm-ubuntu22.04-sury
image: geschke/php-fpm-swrm
permissions:
contents: read
packages: write
Expand All @@ -33,10 +44,21 @@ jobs:
uses: docker/setup-buildx-action@v3
-
name: Login to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

# Login to GitHub Container Repository
- name: Log into registry ${{ env.REGISTRY_GITHUB }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY_GITHUB }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

-
name: Copy composer installation file
run: |
Expand Down Expand Up @@ -68,16 +90,20 @@ jobs:
echo "run_build=true" >> "$GITHUB_OUTPUT"
fi
- name: Test step after query
- name: Test build image
if: "${{ steps.query_tag.outputs.run_build == 'true' }}"
run: |
echo "build docker image ${{ matrix.directory }} ${{ matrix.image }} here... with tag ${{ steps.generate_tag.outputs.full_tag }} "
#-
# name: Build and push
# uses: docker/build-push-action@v6
# with:
# context: .
# file: ${{ matrix.directory }}/Dockerfile
# push: false
# load: true
# tags: ${{ matrix.tagging }}
-
name: Build and push
if: "${{ steps.query_tag.outputs.run_build == 'true' }}"
uses: docker/build-push-action@v6
with:
context: .
file: ${{ matrix.directory }}/Dockerfile
push: false
load: true
tags: |
${{ env.IMAGE_NAME }}:${{ steps.generate_tag.outputs.full_tag }}
${{ env.REGISTRY_GITHUB }}/${{ env.IMAGE_NAME }}:${{ steps.generate_tag.outputs.full_tag }}

0 comments on commit 3897d83

Please sign in to comment.