-
Notifications
You must be signed in to change notification settings - Fork 23
48 lines (43 loc) · 1.57 KB
/
publish-php-debug-images.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: build-debug-image
on:
schedule:
- cron: "0 0 * * 0"
workflow_dispatch:
jobs:
push_to_registry:
if: github.repository_owner == 'open-telemetry' #do not run in forks
name: Build image
strategy:
fail-fast: false
matrix:
php-version: ['8.0', '8.1', '8.2']
os: ['debian', 'alpine']
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: check out the repo
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Fetch latest PHP version
run: |
PHP_VERSION=$(curl https://www.php.net/releases/index.php?json\&version=${{ matrix.php-version }}\&max=1 | jq -r 'keys[0]')
echo "PHP_VERSION=${PHP_VERSION}" >> $GITHUB_ENV
echo "Latest version in ${{ matrix.php-version }} is ${PHP_VERSION}"
- name: Build and push ${{ env.PHP_VERSION }} as ${{ matrix.php-version }}-${{ matrix.os }} to ghcr.io
uses: docker/build-push-action@v3
with:
push: true
file: docker/Dockerfile.${{ matrix.os }}
build-args: |
PHP_VERSION=${{ env.PHP_VERSION }}
PHP_CONFIG_OPTS=--enable-debug
tags: ghcr.io/open-telemetry/opentelemetry-php-instrumentation/php:${{ matrix.php-version }}-${{ matrix.os }}-debug