Skip to content

.github/workflows/cd-backend-deploy-docker-image.yml #7

.github/workflows/cd-backend-deploy-docker-image.yml

.github/workflows/cd-backend-deploy-docker-image.yml #7

name: CD-Backend Deploy Docker image
on:
workflow_run:
workflows: ["CI-Backend"]
types:
- completed
# pull_request:
# branches:
# - main
jobs:
deploy-docker-image:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r app/requirements.txt
- name: Log in to Docker Hub
run: |
echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: Build Docker image
run: |
docker build --platform linux/amd64/v2 -t enricogoerlitz/bp2-backend-amd64v2 -f ./docker/Dockerfile .
- name: Push Docker image
run: |
docker push enricogoerlitz/bp2-backend-amd64v2:latest