-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (53 loc) · 1.71 KB
/
docker.yml
File metadata and controls
62 lines (53 loc) · 1.71 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
name: Docker Image
env:
IMAGE: ghcr.io/yiisoft-contrib/php-dev
on:
workflow_dispatch: ~
workflow_run:
workflows: [ "Checks" ]
branches: [ "master" ]
types:
- completed
permissions:
contents: read
packages: write
jobs:
build:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
concurrency:
group: docker-image-build-${{ matrix.php }}
cancel-in-progress: true
strategy:
matrix:
php: ['8.1', '8.2', '8.3', '8.4', '8.5']
steps:
- name: Get current timestamp
id: timestamp
run: echo "rfc3339=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
- name: Checkout
uses: actions/checkout@v6
- name: Login to GitHub container registry
uses: docker/login-action@v3
with:
registry: https://ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Docker QEMU
uses: docker/setup-qemu-action@v3
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build & push image
uses: docker/build-push-action@v6
with:
context: docker
build-args: PHP_VERSION=${{ matrix.php }}
platforms: linux/amd64,linux/arm64
tags: ${{ env.IMAGE }}:${{ matrix.php }}
push: ${{ github.ref == 'refs/heads/master' }}
labels: |
org.opencontainers.image.source=${{ github.event.repository.html_url }}
org.opencontainers.image.created=${{ steps.timestamp.outputs.rfc3339 }}
org.opencontainers.image.revision=${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max