Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions .github/workflows/docker-hub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ on:
- cron: '0 0 * * 0'

env:
REGISTRY_USERNAME: garypendergast
REGISTRY_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
PACKAGE_REGISTRY_HOST:
PACKAGE_REGISTRY: wordpressdevelop
PR_TAG:

Expand All @@ -46,13 +43,15 @@ jobs:
name: PHP ${{ matrix.php }} Image
runs-on: ubuntu-latest

environment: 'Docker Hub'
strategy:
matrix:
php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5' ]
fail-fast: false
env:
PHP_VERSION: ${{ matrix.php }}
PHP_LATEST: '8.3'
REGISTRY_USERNAME: ${{ vars.REGISTRY_USERNAME }}
permissions:
contents: read

Expand All @@ -63,13 +62,14 @@ jobs:
persist-credentials: false

- name: Login to the package registry
run: |
echo "$REGISTRY_PASSWORD" | docker login "$PACKAGE_REGISTRY_HOST" -u "$REGISTRY_USERNAME" --password-stdin
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
with:
username: ${{ env.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}

- name: Build Docker image
run: |
docker build \
--build-arg PACKAGE_REGISTRY="$PACKAGE_REGISTRY" \
--build-arg PR_TAG="$PR_TAG" \
-t "$PACKAGE_REGISTRY/php:$PHP_VERSION-fpm$PR_TAG" \
"images/$PHP_VERSION/php"
Comment thread
desrosj marked this conversation as resolved.
Expand All @@ -91,6 +91,7 @@ jobs:
name: CLI on PHP ${{ matrix.php }}
runs-on: ubuntu-latest
needs: build-php-images
environment: 'Docker Hub'
strategy:
matrix:
php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5' ]
Expand All @@ -101,16 +102,18 @@ jobs:
env:
PHP_VERSION: ${{ matrix.php }}
PHP_LATEST: '8.3'

REGISTRY_USERNAME: ${{ vars.REGISTRY_USERNAME }}
steps:
Comment thread
desrosj marked this conversation as resolved.
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

- name: Login to the package registry
run: |
echo "$REGISTRY_PASSWORD" | docker login "$PACKAGE_REGISTRY_HOST" -u "$REGISTRY_USERNAME" --password-stdin
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
with:
username: ${{ env.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}

- name: Build Docker image
run: |
Expand Down
23 changes: 14 additions & 9 deletions .github/workflows/github-container-registry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ on:
workflow_dispatch:

env:
REGISTRY_USERNAME: desrosj
REGISTRY_PASSWORD: ${{ secrets.GHCR_TOKEN }}
PACKAGE_REGISTRY_HOST: ghcr.io
PACKAGE_REGISTRY: ghcr.io/wordpress/wpdev-docker-images
PR_TAG: -${{ github.event.number }}

Expand Down Expand Up @@ -59,13 +56,15 @@ jobs:
name: PHP ${{ matrix.php }} Image
runs-on: ubuntu-latest
needs: [ check-for-changes ]
environment: 'GitHub Container Registry'
strategy:
matrix:
php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5' ]
fail-fast: false
env:
PHP_VERSION: ${{ matrix.php }}
PHP_LATEST: '8.3'
REGISTRY_USERNAME: ${{ vars.REGISTRY_USERNAME }}
permissions:
contents: read

Expand All @@ -76,13 +75,15 @@ jobs:
persist-credentials: false

- name: Login to the package registry
run: |
echo "$REGISTRY_PASSWORD" | docker login "$PACKAGE_REGISTRY_HOST" -u "$REGISTRY_USERNAME" --password-stdin
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
with:
registry: ghcr.io
username: ${{ env.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}

- name: Build Docker image
run: |
docker build \
--build-arg PACKAGE_REGISTRY="$PACKAGE_REGISTRY" \
--build-arg PR_TAG="$PR_TAG" \
-t "$PACKAGE_REGISTRY/php:$PHP_VERSION-fpm$PR_TAG" \
"images/$PHP_VERSION/php"
Comment thread
desrosj marked this conversation as resolved.
Expand All @@ -104,6 +105,7 @@ jobs:
name: CLI on PHP ${{ matrix.php }}
runs-on: ubuntu-latest
needs: build-php-images
environment: 'GitHub Container Registry'
strategy:
matrix:
php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5' ]
Expand All @@ -114,16 +116,19 @@ jobs:
env:
PHP_VERSION: ${{ matrix.php }}
PHP_LATEST: '8.3'

REGISTRY_USERNAME: ${{ vars.REGISTRY_USERNAME }}
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

- name: Login to the package registry
run: |
echo "$REGISTRY_PASSWORD" | docker login "$PACKAGE_REGISTRY_HOST" -u "$REGISTRY_USERNAME" --password-stdin
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
with:
registry: ghcr.io
username: ${{ env.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}

- name: Build Docker image
run: |
Expand Down
26 changes: 14 additions & 12 deletions templates/workflow.yml-template
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ on:
- cron: '0 0 * * 0'

env:
REGISTRY_USERNAME: garypendergast
REGISTRY_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
PACKAGE_REGISTRY_HOST:
PACKAGE_REGISTRY: wordpressdevelop
PR_TAG:
%%/DOCKER_HUB%%
Expand All @@ -31,9 +28,6 @@ on:
workflow_dispatch:

env:
REGISTRY_USERNAME: desrosj
REGISTRY_PASSWORD: ${{ secrets.GHCR_TOKEN }}
PACKAGE_REGISTRY_HOST: ghcr.io
PACKAGE_REGISTRY: ghcr.io/wordpress/wpdev-docker-images
PR_TAG: -${{ github.event.number }}
%%/GITHUB%%
Expand Down Expand Up @@ -77,13 +71,15 @@ jobs:
name: PHP ${{ matrix.php }} Image
runs-on: ubuntu-latest
%%GITHUB%%needs: [ check-for-changes ]%%/GITHUB%%
environment: '%%GITHUB%%GitHub Container Registry%%/GITHUB%%%%DOCKER_HUB%%Docker Hub%%/DOCKER_HUB%%'
strategy:
matrix:
php: [ %%PHP_VERSION_LIST%% ]
fail-fast: false
env:
PHP_VERSION: ${{ matrix.php }}
PHP_LATEST: '%%PHP_LATEST%%'
REGISTRY_USERNAME: ${{ vars.REGISTRY_USERNAME }}
permissions:
contents: read

Expand All @@ -94,13 +90,15 @@ jobs:
persist-credentials: false

- name: Login to the package registry
run: |
echo "$REGISTRY_PASSWORD" | docker login "$PACKAGE_REGISTRY_HOST" -u "$REGISTRY_USERNAME" --password-stdin
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
with:%%GITHUB%%
registry: ghcr.io%%/GITHUB%%
username: ${{ env.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
Comment thread
desrosj marked this conversation as resolved.

- name: Build Docker image
run: |
docker build \
--build-arg PACKAGE_REGISTRY="$PACKAGE_REGISTRY" \
--build-arg PR_TAG="$PR_TAG" \
-t "$PACKAGE_REGISTRY/php:$PHP_VERSION-fpm$PR_TAG" \
"images/$PHP_VERSION/php"
Expand All @@ -122,6 +120,7 @@ jobs:
name: CLI on PHP ${{ matrix.php }}
runs-on: ubuntu-latest
needs: build-php-images
environment: '%%GITHUB%%GitHub Container Registry%%/GITHUB%%%%DOCKER_HUB%%Docker Hub%%/DOCKER_HUB%%'
strategy:
matrix:
php: [ %%PHP_VERSION_LIST%% ]
Expand All @@ -132,16 +131,19 @@ jobs:
env:
PHP_VERSION: ${{ matrix.php }}
PHP_LATEST: '%%PHP_LATEST%%'

REGISTRY_USERNAME: ${{ vars.REGISTRY_USERNAME }}
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

- name: Login to the package registry
run: |
echo "$REGISTRY_PASSWORD" | docker login "$PACKAGE_REGISTRY_HOST" -u "$REGISTRY_USERNAME" --password-stdin
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
with:%%GITHUB%%
registry: ghcr.io%%/GITHUB%%
username: ${{ env.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}

- name: Build Docker image
run: |
Expand Down
Loading