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

50 lines
1.6 KiB
YAML
Raw Normal View History

2021-12-22 08:36:16 +03:00
name: Publish 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
2022-02-27 01:22:55 +03:00
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
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
2022-02-27 01:22:55 +03:00
uses: docker/metadata-action@e5622373a38e60fb6d795a4421e56882f2d7a681
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
2022-02-27 01:22:55 +03:00
uses: docker/build-push-action@7f9d37fa544684fb73bfe4835ed7214c255ce02b
with:
context: .
2022-03-24 05:38:06 +03:00
file: {context}/Containerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
2021-12-16 00:57:43 +03:00
- name: Update Readme and short description
2022-02-27 01:22:55 +03:00
uses: peter-evans/dockerhub-description@616d1b63e806b630b975af3b4fe3304307b20f40
2021-12-16 00:57:43 +03:00
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
2022-03-21 23:08:54 +03:00
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
2021-12-16 00:57:43 +03:00
repository: krateng/maloja
short-description: ${{ github.event.repository.description }}