1
0
mirror of https://github.com/krateng/maloja.git synced 2023-08-10 21:12:55 +03:00
maloja/.github/workflows/dockerhub.yml

41 lines
1.1 KiB
YAML
Raw Normal View History

name: Publish Docker image to Dockerhub
on:
push:
tags:
2021-12-15 21:47:34 +03:00
- 'v*'
jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
2021-12-15 20:36:00 +03:00
- name: Log in to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
2021-12-15 20:36:00 +03:00
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3
with:
images: krateng/maloja
# generate Docker tags based on the following events/attributes
tags: |
type=semver,pattern={{version}}
flavor: |
2021-12-15 21:47:34 +03:00
latest=true
2021-12-15 20:36:00 +03:00
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}