Skip to content

ci+feat: Updated all workflow actions and added release/change-logs #21

ci+feat: Updated all workflow actions and added release/change-logs

ci+feat: Updated all workflow actions and added release/change-logs #21

name: Docker Build and Push
on:
push:
branches:
- main
paths:
- 'ci/**'
- 'wbmbot_v2/**'
workflow_run:
workflows: ["Release and Auto Change Log"]
types:
- completed
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Get latest tag
id: latest_tag
run: echo "::set-output name=TAG::$(git describe --abbrev=0 --tags || echo '')"
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build Docker image
if: steps.latest_tag.outputs.TAG != ''
run: docker build -t vel7an/wbmbot_v2:${{ steps.latest_tag.outputs.TAG }} -t vel7an/wbmbot_v2:latest -f ci/docker/Dockerfile .
- name: Push Docker image to Docker Hub
if: steps.latest_tag.outputs.TAG != ''
run: |
docker push vel7an/wbmbot_v2:${{ steps.latest_tag.outputs.TAG }}
docker push vel7an/wbmbot_v2:latest