Skip to content

Commit

Permalink
Merge pull request #1435 from totvs/pipeline_docker
Browse files Browse the repository at this point in the history
Pipeline docker hub
  • Loading branch information
renanllisboa authored Jun 25, 2024
2 parents 091af17 + 263efc8 commit e4da9ec
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 6 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: docker

on:
# Permite execução disparada por outra pipeline
workflow_call:

# Permite executar manualmente
workflow_dispatch:

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: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV

- 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
6 changes: 5 additions & 1 deletion .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,8 @@ jobs:
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist
twine upload dist/*
twine upload dist/*
callDocker:
needs: [deploy]
uses: ./.github/workflows/docker.yml
6 changes: 1 addition & 5 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ FROM python:3.7

ENV DEBIAN_FRONTEND=noninteractive

USER root

RUN apt-get update && apt-get install -y \
unixodbc-dev \
libgtk-3-0 \
Expand All @@ -19,6 +17,4 @@ RUN curl -sL "https://download.mozilla.org/?product=firefox-latest&os=linux64" -
rm t.tar.bz2

RUN pip3 install tir_framework --upgrade && \
find /usr -name geckodriver | xargs chmod +x

USER ${USERNAME}
find /usr -name geckodriver | xargs chmod +x

0 comments on commit e4da9ec

Please sign in to comment.