Skip to content

docker

docker #2

Workflow file for this run

name: docker
on:
# Permite execução disparada por outra pipeline
workflow_call:
secrets:
DOCKERHUB_USERNAME:
required: true
DOCKERHUB_TOKEN:
required: true
# Permite executar manualmente
workflow_dispatch:
inputs:
release:
description: 'Set tag version (sem v)'
required: true
env:
IMAGENAME: 'totvsengpro/tir'
jobs:
dockerHub:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Captura a versão da release gerada (ex.: refs/tags/v1.1.1 > 1.1.1)
- name: Set release
run: |
if [ -z "${{ inputs.release }}" ]; then
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV
else
echo "RELEASE_VERSION=${{ inputs.release }}" >> $GITHUB_ENV
fi
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
env:
DOCKER_BUILD_NO_SUMMARY: true
with:
file: docker/Dockerfile
push: true
tags: ${{ env.IMAGENAME }}:${{ env.RELEASE_VERSION }},${{ env.IMAGENAME }}:latest