diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..6730242 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,34 @@ +name: Docker Image + +on: + release: + types: published + tags: + - v* + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Docker meta + id: meta + uses: crazy-max/ghaction-docker-meta@v2 + with: + images: gyrogearl00se/solacewebclient + tags: | + type=raw,value=latest,enable=${{ endsWith(GitHub.ref, 'master') }} + type=ref,event=tag + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push Docker images + uses: docker/build-push-action@v2.6.1 + with: + push: ${{ GitHub.event_name != 'pull_request' || contains(GitHub.head_ref, 'feature') }} + tags: ${{ steps.meta.outputs.tags }}