Skip to content

Commit 4e108e1

Browse files
authored
Merge pull request brefphp#48 from brefphp/depot-oicd
2 parents f8ae0ad + f9d7a46 commit 4e108e1

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

.github/workflows/tests.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ on:
66
pull_request:
77
branches: [ '*' ]
88

9+
permissions:
10+
# allow issuing OIDC tokens, needed for the depot.dev auth
11+
id-token: write
12+
# allow at least reading the repo contents, add other permissions if necessary
13+
contents: read
14+
915
jobs:
1016
tests:
1117
name: Build and tests PHP ${{ matrix.php_version }}, ${{ matrix.cpu }}
@@ -29,12 +35,18 @@ jobs:
2935

3036
- uses: depot/setup-action@v1
3137

38+
# We use this action instead of running `make docker-images-php-XX` directly because it lets us
39+
# use OIDC authentication instead of a secret. Secrets can't be used in pull request builds.
3240
- name: Build Docker images
33-
run: make docker-images-php-${{ matrix.php_version }}
41+
uses: depot/bake-action@v1
42+
with:
43+
load: true
3444
env:
3545
CPU: ${{ matrix.cpu }}
36-
USE_DEPOT: 1
37-
DEPOT_TOKEN: ${{ secrets.DEPOT_TOKEN }}
46+
CPU_PREFIX: ${{ (matrix.cpu == 'arm') && 'arm-' || '' }}
47+
PHP_VERSION: ${{ matrix.php_version }}
48+
IMAGE_VERSION_SUFFIX: ${{ (matrix.cpu == 'arm') && 'arm64' || 'x86_64' }}
49+
DOCKER_PLATFORM: ${{ (matrix.cpu == 'arm') && 'linux/arm64' || 'linux/amd64' }}
3850

3951
- name: Test that layers can be exported
4052
run: |

0 commit comments

Comments
 (0)