Skip to content

Commit be6de2b

Browse files
publish docker image to docker hub automatically when a release is done (#58)
1 parent 9baf531 commit be6de2b

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

.github/workflows/update_version.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,35 @@ jobs:
5858
release_name: ${{ steps.tag.outputs.new_tag }}
5959
commitish: master
6060
body: "Upgrade PHPStan to ${{ steps.tag.outputs.new_tag }}"
61+
62+
publish_docker_images:
63+
needs: [update-version]
64+
runs-on: ubuntu-20.04
65+
66+
if: github.ref == 'refs/heads/master' || github.event_name == 'release'
67+
steps:
68+
- name: Checkout
69+
uses: actions/checkout@v2
70+
- name: Docker meta
71+
id: meta
72+
uses: crazy-max/ghaction-docker-meta@v2
73+
with:
74+
images: oskarstark/phpstan-ga
75+
tags: |
76+
type=raw,value=latest,enable=${{ endsWith(github.ref, 'master') }}
77+
type=ref,event=tag
78+
flavor: |
79+
latest=false
80+
- name: Login to DockerHub
81+
if: github.event_name != 'pull_request'
82+
uses: docker/login-action@v1
83+
with:
84+
username: ${{ secrets.DOCKERHUB_USERNAME }}
85+
password: ${{ secrets.DOCKERHUB_TOKEN }}
86+
- name: Build and push
87+
uses: docker/build-push-action@v2
88+
with:
89+
context: .
90+
push: ${{ github.event_name != 'pull_request' }}
91+
tags: ${{ steps.meta.outputs.tags }}
92+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)