mirror of
https://github.com/mashirozx/docker-php-nginx.git
synced 2024-11-26 08:48:14 +08:00
Fix build on tag creation
This commit is contained in:
parent
da76cd5f6b
commit
3a38277dc8
11
.github/workflows/deploy.yaml
vendored
11
.github/workflows/deploy.yaml
vendored
@ -3,6 +3,7 @@ name: Test & build Docker image
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [ master ]
|
||||||
|
tags: ['*']
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
@ -41,7 +42,6 @@ jobs:
|
|||||||
sarif_file: 'trivy-results.sarif'
|
sarif_file: 'trivy-results.sarif'
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
|
|
||||||
uses: docker/login-action@v1
|
uses: docker/login-action@v1
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
@ -52,7 +52,12 @@ jobs:
|
|||||||
run: |-
|
run: |-
|
||||||
docker push $IMAGE_NAME:latest
|
docker push $IMAGE_NAME:latest
|
||||||
|
|
||||||
|
- name: Set tag in environment
|
||||||
|
if: contains(github.ref, 'refs/tags/')
|
||||||
|
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Push tagged image
|
- name: Push tagged image
|
||||||
if: contains(github.ref, 'refs/tags/v')
|
if: contains(github.ref, 'refs/tags/')
|
||||||
run: |-
|
run: |-
|
||||||
docker push $IMAGE_NAME:$GITHUB_TAG
|
docker tag $IMAGE_NAME:${{ github.sha }} $IMAGE_NAME:$RELEASE_VERSION
|
||||||
|
docker push $IMAGE_NAME:$RELEASE_VERSION
|
||||||
|
Loading…
Reference in New Issue
Block a user