-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (45 loc) · 1.34 KB
/
build-docker-image.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
49
50
51
52
53
name: Update Docker Hub images
on:
push:
tags: "*"
jobs:
build:
name: Update Docker Hub images (PM ${{ matrix.pm-version }})
runs-on: ubuntu-20.04
strategy:
matrix:
pm-version:
- "4"
- "5"
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: actions/checkout@v3
- name: Get tag name
id: tag-name
run: |
VERSION=$(echo "${{ github.ref }}" | sed 's{^refs/tags/{{')
echo TAG_NAME=$VERSION >> $GITHUB_OUTPUT
- name: Build image for tag
uses: docker/[email protected]
with:
push: true
context: ./
tags: |
pmmp/poggit-phpstan:${{ steps.tag-name.outputs.TAG_NAME }}-pm${{ matrix.pm-version }}
build-args: |
PMMP_TAG=${{ matrix.pm-version }}
- name: Build image for latest tag
uses: docker/[email protected]
with:
push: true
context: ./
tags: |
pmmp/poggit-phpstan:latest-pm${{ matrix.pm-version }}
build-args: |
PMMP_TAG=${{ matrix.pm-version }}