forked from phpstan/phpstan
-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (64 loc) · 2.62 KB
/
docker-stable.yml
File metadata and controls
74 lines (64 loc) · 2.62 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
# From:
# https://www.docker.com/blog/docker-github-actions/
# https://github.com/metcalfc/docker-action-examples
name: Docker image stable
on:
push:
tags:
- '2.*'
permissions:
contents: read
jobs:
docker:
runs-on: ubuntu-latest
concurrency: docker-stable-${{ github.ref }}-${{ matrix.docker-file }}
strategy:
fail-fast: false
matrix:
include:
- docker-file: "./docker/Dockerfile.php.8.4"
image-tag-suffix: ""
- docker-file: "./docker/Dockerfile.php.8.0"
image-tag-suffix: "-php8.0"
- docker-file: "./docker/Dockerfile.php.8.1"
image-tag-suffix: "-php8.1"
- docker-file: "./docker/Dockerfile.php.8.2"
image-tag-suffix: "-php8.2"
- docker-file: "./docker/Dockerfile.php.8.3"
image-tag-suffix: "-php8.3"
- docker-file: "./docker/Dockerfile.php.8.4"
image-tag-suffix: "-php8.4"
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Set up QEMU
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
- name: Login to ghcr
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get the version
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT"
- name: Build and push
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5.4.0
with:
builder: ${{ steps.buildx.outputs.name }}
context: ./docker
file: "${{ matrix.docker-file }}"
build-args: |
PHPSTAN_VERSION=${{ steps.get_version.outputs.VERSION }}
push: true
tags: "ghcr.io/phpstan/phpstan:latest${{ matrix.image-tag-suffix }},ghcr.io/phpstan/phpstan:2${{ matrix.image-tag-suffix }},ghcr.io/phpstan/phpstan:${{ steps.get_version.outputs.VERSION }}${{ matrix.image-tag-suffix }}"
platforms: linux/amd64,linux/arm64
cache-from: type=gha, scope=${{ github.workflow }}
cache-to: type=gha, scope=${{ github.workflow }}