Workflow docker push #5
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: Main Taski Workflow | ||
on: | ||
push: | ||
branches: | ||
- master | ||
jobs: | ||
tests: | ||
runs-on: ubuntu-latest | ||
services: | ||
postgres: | ||
image: postgres:13.10 | ||
env: | ||
POSTGRES_USER: django_user | ||
POSTGRES_PASSWORD: django_password | ||
POSTGRES_DB: django_db | ||
ports: | ||
- 5432:5432 | ||
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.9 | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install flake8==6.1.0 flake8-isort==6.1.0 | ||
- name: Test with flake8 | ||
env: | ||
POSTGRES_USER: django_user | ||
POSTGRES_PASSWORD: django_password | ||
POSTGRES_DB: django_db | ||
DB_HOST: 127.0.0.1 | ||
DB_PORT: 5432 | ||
run: | | ||
python -m flake8 backend/ | ||
build_and_push_to_docker_hub: | ||
name: Push Docker image to DockerHub | ||
runs-on: ubuntu-latest | ||
needs: tests | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Login to Docker | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ DOCKER_USERNAME }} | ||
Check failure on line 63 in .github/workflows/main.yml GitHub Actions / Main Taski WorkflowInvalid workflow file
|
||
password: ${{ DOCKER_PASSWORD }} | ||
- name: Push to DockerHub | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: ./backend/ | ||
push: true | ||
tags: ваш-логин-на-docker-hub/taski_backend:latest |