Skip to content

main.yml updated

main.yml updated #5

Workflow file for this run

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: 1 Copy repository
uses: actions/checkout@v2
- name: 2 Docker login
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASSWORD }}
- name: 3 Build APP IMAGE
run: docker build -t app -f /src/app/backend/dockerfile_api .
- name: 4 Tags
run: |
docker tag app ${{ secrets.DOCKER_USER }}/app:${{ github.sha }}
docker tag app ${{ secrets.DOCKER_USER }}/app:latest
- name: 5 SPush
run: |
docker push ${{ secrets.DOCKER_USER }}/app:${{ github.sha }}
docker push ${{ secrets.DOCKER_USER }}/app:latest