-
Notifications
You must be signed in to change notification settings - Fork 3
43 lines (35 loc) · 1.12 KB
/
build.yml
File metadata and controls
43 lines (35 loc) · 1.12 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
name: Build and push Docker images
on:
schedule:
- cron: '0 3 * * 1' # Every Monday at 3am UTC
workflow_dispatch:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['83', '84', '85']
steps:
- name: Get branch names
id: branch-name
uses: tj-actions/branch-names@v9.0.0
- name: Checkout code
uses: actions/checkout@v4
- name: Login to Docker Hub
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Create buildx builder
run: docker buildx create --use
- name: Build branch-specific images
if: steps.branch-name.outputs.current_branch != 'master'
run: ./build.sh both ${{ matrix.php }} ${{ steps.branch-name.outputs.current_branch }}
- name: Build main images
if: steps.branch-name.outputs.current_branch == 'master'
run: ./build.sh both ${{ matrix.php }}