Skip to content

Commit 092d0fe

Browse files
committed
update ci
1 parent 9d9d593 commit 092d0fe

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

.github/workflows/dockerimage.yml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,26 +26,20 @@ jobs:
2626
- name: Set up Docker Buildx
2727
uses: docker/setup-buildx-action@v1
2828

29+
- name: Login to Docker Hub
30+
uses: docker/login-action@v1
31+
with:
32+
username: ${{ secrets.DOCKER_HUB_USER }}
33+
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
34+
2935
- name: Build and push
3036
uses: docker/build-push-action@v2
3137
with:
3238
file: Dockerfile-${{ matrix.php_version }}
3339
platforms: linux/amd64,linux/arm64,linux/386,linux/arm/v7,linux/arm/v6
34-
push: false
35-
tags: laradock/php-fpm:${{ matrix.php_version }}
40+
push: ${{ (github.repository == 'laradock/php-fpm') && (github.ref == 'refs/heads/master') }}
41+
tags: laradock/php-fpm:${{ env.TAG_PREFIX }}-${{ matrix.php_version }}
3642

3743
- name: check
3844
run: |
3945
docker image ls
40-
41-
- name: Build the Docker image
42-
run: |
43-
docker build . --file Dockerfile-${{ matrix.php_version }} --tag laradock/php-fpm:${{ env.TAG_PREFIX }}-${{ matrix.php_version }}
44-
docker image ls
45-
46-
- name: Push image to Docker hub
47-
if: ${{ success() && (github.repository == 'laradock/php-fpm') && (github.ref == 'refs/heads/master') }}
48-
run: |
49-
echo ${{ secrets.DOCKER_HUB_PASSWORD }} | docker login -u ${{ secrets.DOCKER_HUB_USER }} --password-stdin
50-
docker push laradock/php-fpm:${{ env.TAG_PREFIX }}-${{ matrix.php_version }}
51-
docker logout

0 commit comments

Comments
 (0)