Skip to content

Merge pull request #65 from MarcosCostaDev/feature/addesss #30

Merge pull request #65 from MarcosCostaDev/feature/addesss

Merge pull request #65 from MarcosCostaDev/feature/addesss #30

Workflow file for this run

name: Publish Docker image
on:
push:
branches: ["release/*"]
jobs:
build-and-push:
defaults:
run:
working-directory: ./src
name: Build and push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
DOCKER_IMAGE_NAME: marcoslcosta/rinhabackend
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Docker login
run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
- name: Build Docker image
run: docker image build -t ${{ env.DOCKER_IMAGE_NAME }}:${{ github.sha }} -t ${{ env.DOCKER_IMAGE_NAME }}:latest -f RinhaBackEnd/Dockerfile .
- name: Push Docker image
run: docker image push --all-tags ${{ env.DOCKER_IMAGE_NAME }}