Skip to content

Commit

Permalink
Merge pull request #112 from stellarwp/feature/wp-container-image
Browse files Browse the repository at this point in the history
Generate a Docker image for the WordPress container as well
  • Loading branch information
borkweb authored Sep 2, 2022
2 parents 26faf5a + 177308c commit be1bf82
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 1 deletion.
56 changes: 56 additions & 0 deletions .github/workflows/publish-slic-wordpress-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Publish slic-wordpress Docker image

on:
push:
release:
types: [published]

env:
IMAGE_NAME: ${{ github.repository }}-wordpress

jobs:
publish-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/[email protected]
with:
images: ghcr.io/${{ env.IMAGE_NAME }}
tags: |
type=edge,branch=main
type=ref,event=branch
type=ref,event=tag
type=semver,pattern={{raw}}
- name: Build and push slic-wordpress Docker image
uses: docker/[email protected]
continue-on-error: true
with:
context: containers/wordpress
file: containers/wordpress/Dockerfile
push: true
pull: true
tags: |
${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
2 changes: 1 addition & 1 deletion containers/wordpress/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG WORDPRESS_IMAGE_VERSION=wordpress/apache

FROM ${WORDPRESS_IMAGE_VERSION}
FROM wordpress:6.0.2-php7.4-apache
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
RUN chmod a+x /usr/local/bin/install-php-extensions && install-php-extensions xdebug
COPY xdebug-on.sh /usr/local/bin/xdebug-on
Expand Down

0 comments on commit be1bf82

Please sign in to comment.