File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11name : Docker Image CI
22
3- on : [workflow_dispatch]
4- # on:
5- # push:
6- # branches: [ "master", "test" ]
7- # pull_request:
8- # branches: [ "master" ]
3+ on :
4+ workflow_dispatch :
5+ push :
6+ branches : [ "master", "dev/gcr" ]
97
108jobs :
119
12- build_php84 :
13-
10+ build :
1411 runs-on : ubuntu-latest
12+ strategy :
13+ matrix :
14+ include :
15+ - dockerfile_dir : ubuntu_nginx_php81
16+ image_tag : php81
17+ - dockerfile_dir : ubuntu_nginx_php82
18+ image_tag : php82
19+ - dockerfile_dir : ubuntu_nginx_php83
20+ image_tag : php83
21+ - dockerfile_dir : ubuntu_nginx_php84
22+ image_tag : php84
1523
1624 steps :
1725 - uses : actions/checkout@v6
18- - name : Build the Docker image
19- run : cd ubuntu_nginx_php84 && docker buildx build --pull --platform linux/amd64,linux/arm64 . --file Dockerfile --tag my-image-name:$(date +%s)
26+
27+ - name : Set up Docker Buildx
28+ uses : docker/setup-buildx-action@v3
29+
30+ - name : Build Docker image
31+ uses : docker/build-push-action@v5
32+ with :
33+ context : ./${{ matrix.dockerfile_dir }}
34+ file : ./${{ matrix.dockerfile_dir }}/Dockerfile
35+ push : false
36+ tags : |
37+ ${{ matrix.image_tag }}:latest
38+ ${{ matrix.image_tag }}:${{ github.sha }}
39+ outputs : type=docker
2040
2141# 发布 Docker 映像: https://docs.github.com/zh/actions/publishing-packages/publishing-docker-images
You can’t perform that action at this time.
0 commit comments