🚀 Alterado caminho do Dockerfile #8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CICD | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| types: | |
| - closed | |
| workflow_dispatch: | |
| jobs: | |
| BUILD: | |
| if: github.event.pull_request.merged == true | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4.1.1 | |
| - name: Read version file | |
| id: get_version | |
| run: | | |
| VERSION=$(cat version.txt) | |
| echo "app_version=$VERSION" >> $GITHUB_ENV | |
| - name: Docker Login | |
| uses: docker/login-action@v3.0.0 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USER }} | |
| password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
| - name: Criação da Imagem docker | |
| uses: docker/build-push-action@v5.0.0 | |
| with: | |
| context: ./ | |
| file: Dockerfile | |
| push: true | |
| tags: | | |
| secultceara/api-email:latest | |
| secultceara/api-email:${{ env.app_version }} | |
| #DEPLOY: | |
| # needs: BUILD | |
| # runs-on: mapahomolog | |
| # steps: | |
| # - name: Pull da imagem do dockerhub | |
| # run: sudo docker pull secultceara/mapasculturais:homolog | |
| # - name: Restart do docker-compose para atualizar o container com a nova imagem | |
| # run: cd /opt/docker/mapa5 && sudo docker-compose down && sudo docker-compose up -d |