-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (62 loc) · 1.83 KB
/
php.yaml
File metadata and controls
77 lines (62 loc) · 1.83 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: PHP Blueprints CI and CD
on:
push:
paths:
- 'php/**'
pull_request:
paths:
- 'php/**'
env:
REGISTRY: ghcr.io
IMAGE_NAME: code-runner
BUILD_ARG_VERSION_NAME: PHP_VERSION
concurrency:
group: php-${{ github.ref }}
cancel-in-progress: true
jobs:
ci:
runs-on: ubuntu-latest
strategy:
matrix:
php_version: [8.3, 8.4]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build php:${{ matrix.php_version }} image
uses: ./.github/actions/docker-build
with:
context: ./php
dockerfile: ./php/Dockerfile
image-name: ${{ env.IMAGE_NAME }}
tag: php-${{ matrix.php_version }}
push: false
container-registry: ${{ env.REGISTRY }}
build-arg-version-name: ${{ env.BUILD_ARG_VERSION_NAME }}
build-arg-version-value: ${{ matrix.php_version }}
cd:
runs-on: ubuntu-latest
if: ${{ format('refs/heads/{0}', github.event.repository.default_branch) == github.ref }}
strategy:
matrix:
php_version: [8.3, 8.4]
permissions:
packages: write
contents: read
needs:
- ci
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build and push php:${{ matrix.php_version }} image
uses: ./.github/actions/docker-build
with:
context: ./php
dockerfile: ./php/Dockerfile
image-name: ${{ env.IMAGE_NAME }}
tag: php-${{ matrix.php_version }}
push: true
container-registry: ${{ env.REGISTRY }}
container-registry-username: ${{ github.actor }}
container-registry-password: ${{ secrets.GITHUB_TOKEN }}
build-arg-version-name: ${{ env.BUILD_ARG_VERSION_NAME }}
build-arg-version-value: ${{ matrix.php_version }}