Skip to content

Commit b67fccf

Browse files
authored
use GitHub actions bulid/push image (#44)
build and push image tag latest-*.* to docker hub
1 parent e481325 commit b67fccf

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

.github/workflows/dockerimage.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Docker Image CI
2+
3+
on:
4+
push:
5+
branches: master
6+
schedule:
7+
- cron: 0 0 * * 6
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
php_version: [56, 70, 71, 72, 73, 74]
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Build the Docker image
18+
env:
19+
PHP_VERSION: ${{ matrix.php_version }}
20+
run: |
21+
export TAG_VERSION=${PHP_VERSION:0:1}.${PHP_VERSION:1:1}
22+
docker build . --file Dockerfile-${{ matrix.php_version }} --tag laradock/php-fpm:latest-${TAG_VERSION}
23+
docker image ls
24+
25+
- name: Push image to Docker hub
26+
if: success()
27+
env:
28+
PHP_VERSION: ${{ matrix.php_version }}
29+
run: |
30+
export TAG_VERSION=${PHP_VERSION:0:1}.${PHP_VERSION:1:1}
31+
echo ${{ secrets.DOCKER_HUB_PASSWORD }} | docker login -u ${{ secrets.DOCKER_HUB_USER }} --password-stdin
32+
docker push laradock/php-fpm:latest-${TAG_VERSION}
33+
docker logout

0 commit comments

Comments
 (0)