edited main.yml #4
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 to DockerHub | |
on: | |
push: | |
branches: | |
- develop | |
jobs: | |
push_to_registry: | |
name: Push Docker image to Docker Hub | |
runs-on: ubuntu-latest | |
steps: | |
- name: Copy repository | |
uses: actions/checkout@v2 | |
- name: Docker login | |
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASSWORD }} | |
- name: Build APP IMAGE | |
run: docker build -t app -f /src/app/backend/dockerfile_api . | |
- name: Tags | |
run: | | |
docker tag app ${{ secrets.DOCKER_USER }}/app:${{ github.sha }} | |
docker tag app ${{ secrets.DOCKER_USER }}/app:latest | |
- name: Push | |
run: | | |
docker push ${{ secrets.DOCKER_USER }}/app:${{ github.sha }} | |
docker push ${{ secrets.DOCKER_USER }}/app:latest |