Merge pull request #65 from MarcosCostaDev/feature/addesss #30
This file contains 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: 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 }} |