-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (51 loc) · 1.75 KB
/
build-images.yaml
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: build images
on:
workflow_call:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout GitHub Action
uses: actions/checkout@main
- name: Install python3
run: sudo apt install -y python3 python3-click python3-git
- name: Referencing local Modules and Libraries
run: python3 ./cli modules reference-libraries --no-symlink
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set Swap Space
uses: pierotofy/set-swap-space@master
with:
swap-size-gb: 10
- name: Build Image
run: |
tag="${{ github.ref_name }}"
if [ "${{ github.ref_type }}" = "branch" ]; then
# Sanitize the tag by replacing invalid characters with a hyphen
tag="branch-$(echo "$tag" | sed 's/[\/:]/-/g')"
fi
docker build . \
--file ".resources/Containerfile" \
--tag "ghcr.io/${{ github.repository }}/${{ matrix.module }}:$tag" \
--build-arg "MODULE=${{ matrix.module }}" \
--build-arg "PHP_VERSION=${{ matrix.php_version }}"
docker push "ghcr.io/${{ github.repository }}/${{ matrix.module }}:$tag"
strategy:
matrix:
include:
- module: zmsadmin
php_version: "8.0"
- module: zmsapi
php_version: "8.0"
- module: zmscalldisplay
php_version: "8.0"
- module: zmsmessaging
php_version: "8.0"
- module: zmsstatistic
php_version: "8.0"
- module: zmsticketprinter
php_version: "8.0"