forked from openemr/openemr-devops
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (55 loc) · 1.88 KB
/
Copy pathbuild-flex-core.yml
File metadata and controls
57 lines (55 loc) · 1.88 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
name: Flex Docker Build Core
on:
workflow_call:
inputs:
alpine_version:
required: true
type: string
php_versions:
required: true
type: string
php_default:
required: true
type: string
is_default_flex:
required: true
type: boolean
jobs:
build:
if: github.repository_owner == 'openemr' && github.repository == 'openemr/openemr-devops' && github.ref == 'refs/heads/master'
runs-on: ubuntu-22.04
strategy:
matrix:
php_version: ${{ fromJson(inputs.php_versions) }}
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build tags
id: build_tags
run: |
TAGS="openemr/openemr:flex-${{ inputs.alpine_version }}-php-${{ matrix.php_version }}"
if [ "${{ matrix.php_version }}" == "${{ inputs.php_default }}" ]; then
TAGS="$TAGS,openemr/openemr:flex-${{ inputs.alpine_version }}"
if [ "${{ inputs.is_default_flex }}" == "true" ]; then
TAGS="$TAGS,openemr/openemr:flex"
fi
fi
echo "tags=$TAGS" >> $GITHUB_OUTPUT
- name: Build and push flex ${{ inputs.alpine_version }} docker (PHP ${{ matrix.php_version }})
uses: docker/build-push-action@v5
with:
context: "{{defaultContext}}:docker/openemr/flex"
tags: ${{ steps.build_tags.outputs.tags }}
platforms: linux/amd64,linux/arm64
build-args: |
ALPINE_VERSION=${{ inputs.alpine_version }}
PHP_VERSION=${{ matrix.php_version }}
push: true
no-cache: true