Skip to content

Docker Build and Push #27

Docker Build and Push

Docker Build and Push #27

name: Docker Build and Push
on:
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: Fetch tags
run: git fetch --tags
- name: Get latest tag
id: latest_tag
run: echo "TAG=$(git describe --abbrev=0 --tags || echo '')" >> "$GITHUB_ENV"
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build Docker image
run: docker build -t vel7an/wbmbot_v2:${TAG} -t vel7an/wbmbot_v2:latest -f ci/docker/Dockerfile .
- name: Push Docker image to Docker Hub
run: |
docker push vel7an/wbmbot_v2:${TAG}
docker push vel7an/wbmbot_v2:latest