Skip to content

Commit

Permalink
publish docker image to docker hub automatically when a release is do…
Browse files Browse the repository at this point in the history
…ne (#58)
  • Loading branch information
AlessandroMinoccheri committed Feb 5, 2023
1 parent 9baf531 commit be6de2b
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/update_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,35 @@ jobs:
release_name: ${{ steps.tag.outputs.new_tag }}
commitish: master
body: "Upgrade PHPStan to ${{ steps.tag.outputs.new_tag }}"

publish_docker_images:
needs: [update-version]
runs-on: ubuntu-20.04

if: github.ref == 'refs/heads/master' || github.event_name == 'release'
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Docker meta
id: meta
uses: crazy-max/ghaction-docker-meta@v2
with:
images: oskarstark/phpstan-ga
tags: |
type=raw,value=latest,enable=${{ endsWith(github.ref, 'master') }}
type=ref,event=tag
flavor: |
latest=false
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit be6de2b

Please sign in to comment.