2021-12-22 08:36:16 +03:00
|
|
|
name: Publish to Dockerhub
|
2021-12-13 17:20:03 +03:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
2021-12-15 21:47:34 +03:00
|
|
|
- 'v*'
|
2021-12-13 17:20:03 +03:00
|
|
|
|
|
|
|
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
|
|
|
|
2021-12-13 17:20:03 +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 }}
|
|
|
|
|
2021-12-13 17:20:03 +03:00
|
|
|
- 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
|
|
|
|
2021-12-13 17:20:03 +03:00
|
|
|
- name: Build and push Docker image
|
|
|
|
uses: docker/build-push-action@v2
|
|
|
|
with:
|
|
|
|
context: .
|
2022-04-10 16:56:00 +03:00
|
|
|
file: Containerfile
|
2021-12-13 17:20:03 +03:00
|
|
|
push: ${{ github.event_name != 'pull_request' }}
|
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|
2021-12-16 00:57:43 +03:00
|
|
|
|
2022-04-05 17:08:13 +03:00
|
|
|
# skipping this until https://github.com/peter-evans/dockerhub-description/issues/10 is fixed
|
|
|
|
# - name: Update Readme and short description
|
|
|
|
# uses: peter-evans/dockerhub-description@v2
|
|
|
|
# with:
|
|
|
|
# username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
# password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
|
|
|
|
# repository: krateng/maloja
|
|
|
|
# short-description: ${{ github.event.repository.description }}
|