extended github action with proper tags/labels

This commit is contained in:
Jan Koppe 2021-10-30 09:35:23 +02:00
parent c6a9034be1
commit 3125c1b750
Signed by: thunfisch
GPG Key ID: BE935B0735A2129B
1 changed files with 13 additions and 2 deletions

View File

@ -4,6 +4,8 @@ on:
push: push:
branches: branches:
- 'main' - 'main'
tags:
- 'v*'
pull_request: pull_request:
jobs: jobs:
@ -16,8 +18,15 @@ jobs:
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1 uses: docker/setup-buildx-action@v1
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: ghcr.io/${{ github.repository }}
- name: Login to Github Packages - name: Login to Github Packages
uses: docker/login-action@v1 uses: docker/login-action@v1
if: github.event_name != 'pull_request'
with: with:
registry: ghcr.io registry: ghcr.io
username: ${{ github.actor }} username: ${{ github.actor }}
@ -27,5 +36,7 @@ jobs:
id: docker_build id: docker_build
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
with: with:
push: ${{ github.ref == 'refs/heads/main' }} context: .
tags: ghcr.io/chaoswest-tv/concierge:latest push: ${{ github.event_name != 'pull_request'}}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}