-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (50 loc) · 1.76 KB
/
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
54
55
56
57
58
59
name: Update Docker image
on:
release:
types:
- published
env:
REGISTRY: ghcr.io
SERVER_NAME: shockedplot7560/pmmpunit
IMAGE_NAME: tests-runner
jobs:
build:
name: Update Docker image
runs-on: ${{ matrix.image }}
strategy:
matrix:
image: [ubuntu-20.04]
php: [ "8.1", "8.2", "8.3" ]
repo:
- name: pmmp/PocketMine-MP
namespace: pmmp
version: 5.15.0
- name: Plutonium-Mcpe/PocketMine-MP
namespace: plutonium
version: 5.100.1
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9dc751fe249ad99385a2583ee0d084c400eee04e
with:
images: ${{ env.REGISTRY }}/${{ env.SERVER_NAME }}/${{ env.IMAGE_NAME }}-php${{ matrix.php }}
- name: Get name of Docker repository name
id: docker-repo-name
run: echo NAME=$(echo "${GITHUB_REPOSITORY,,}") >> $GITHUB_OUTPUT
- name: Build image for tag
uses: docker/[email protected]
with:
push: true
tags: ${{ steps.meta.outputs.tags }},${{ env.REGISTRY }}/${{ env.SERVER_NAME }}/${{ env.IMAGE_NAME }}-php${{ matrix.php }}-${{ matrix.repo.namespace }}:latest
build-args: |
PHP_VERSION=${{ matrix.php }}
PMMP_REPO=${{ matrix.repo.name }}
PMMP_TAG=${{ matrix.repo.version }}