Use type switch to properly handle RGBA images from Decap #32
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and push to dockerhub | |
on: | |
push: | |
branches: | |
- 'dev' | |
tags: | |
- 'v*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Git checkout | |
uses: actions/checkout@v3 | |
- name: Login to dockerhub | |
uses: docker/login-action@v2 | |
with: | |
username: jobindex | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
- name: Tag image with version | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: jobindex/${{ github.event.repository.name }} | |
tags: | | |
# output dev | |
type=ref,event=branch | |
# output 0.1.2 | |
type=semver,pattern={{version}} | |
# output 0.1 | |
type=semver,pattern={{major}}.{{minor}} | |
# disabled if major zero | |
type=semver,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/v0.') }} | |
- name: Build and push | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} |