Merge pull request #164 from jabdoa2/support_extra_annotations #52
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 | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- '*' | |
jobs: | |
build: | |
env: | |
image_name: wave | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
- name: Get image tags | |
id: image_tags | |
run: | | |
echo -n ::set-output name=IMAGE_TAGS:: | |
TAGS=('${{ vars.REGISTRY_REPOSITORY}}/${{ env.image_name }}:latest') | |
GIT_HASH=$(git rev-parse --short "$GITHUB_SHA") | |
TAGS+=("${{ vars.REGISTRY_REPOSITORY}}/${{ env.image_name }}:$GIT_HASH") | |
if [[ "${GITHUB_REF}" =~ refs/tags/(.*) ]]; then | |
TAGS+=("${{ vars.REGISTRY_REPOSITORY}}/${{ env.image_name }}:${BASH_REMATCH[1]}") | |
fi | |
( IFS=$','; echo "${TAGS[*]}" ) | |
- name: Get binary version | |
id: version | |
run: | | |
echo -n ::set-output name=VERSION:: | |
VERSION=$(git describe --always --dirty --tags 2>/dev/null || echo "undefined") | |
( echo "$VERSION" ) | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Quay.io | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ vars.REGISTRY_URI }} | |
username: ${{ secrets.REGISTRY_USERNAME }} | |
password: ${{ secrets.REGISTRY_PASSWORD }} | |
- name: Build and publish image to Quay | |
uses: docker/build-push-action@v5 | |
with: | |
build-args: | | |
VERSION=${{ steps.version.outputs.VERSION }} | |
tags: "${{ steps.image_tags.outputs.IMAGE_TAGS }}" | |
platforms: linux/amd64,linux/arm64 | |
push: true |