durchsage/.github/workflows/build-and-publish.yml

42 lines
993 B
YAML
Raw Normal View History

name: Build and Publish
on:
push:
branches:
2021-10-16 20:18:51 +02:00
- 'main'
2021-10-30 09:40:55 +02:00
tags:
- 'v*'
pull_request:
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
2021-10-30 09:40:55 +02:00
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: ghcr.io/${{ github.repository }}
- name: Login to Github Packages
uses: docker/login-action@v1
2021-10-30 09:40:55 +02:00
if: github.event_name != 'pull_request'
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
2021-10-30 09:40:55 +02:00
context: .
push: ${{ github.event_name != 'pull_request'}}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}