Skip to content

Publish Docker image #312

Publish Docker image

Publish Docker image #312

name: Publish Docker image
on:
schedule:
# At the end of every day
- cron: '0 0 * * *'
workflow_dispatch:
# inputs:
# run:
# description: 'Dummy button'
# required: false
# default: true
# type: boolean
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
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install -U pip
sudo apt-get install wget grep jq
- name: Compare version from pip and docker and set version
id: getversion
run: |
./scripts/auto_publish/compare-versions
- name: VERSION found
if: "${{ steps.getversion.outputs.version != '' }}"
run: echo ${{ steps.getversion.outputs.version }}
- name: Log in to Docker Hub
uses: docker/login-action@v2
if: "${{ steps.getversion.outputs.version != '' }}"
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker image
uses: docker/build-push-action@v2
if: "${{ steps.getversion.outputs.version != '' }}"
with:
context: .
push: true
build-args: |
CZ_VERSION=${{ steps.getversion.outputs.version }}
tags: |
commitizen/commitizen:3
commitizen/commitizen:latest
commitizen/commitizen:${{ steps.getversion.outputs.version }}