Skip to content

Update ci-pipeline.yml #74

Update ci-pipeline.yml

Update ci-pipeline.yml #74

Workflow file for this run

name: CI Pipeline
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Install Poetry
run: |
python -m pip install --upgrade pip
pip install pipx
pipx install poetry
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install dependencies
run: poetry install
- name: Test with Pytest
run: poetry run pytest
- name: Lint with flake8
run: poetry run flake8
docker:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set up Docker
uses: docker/setup-buildx-action@v1
- name: Build Docker Image
run: |
docker buildx create --use
docker buildx build -t emmylong1/devops-interview:v1 .
env:
DOCKER_CLI_AGGREGATE: 1
- name: Push to Docker Hub
run: |
echo "${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}" | docker login -u "${{ secrets.DOCKER_HUB_USERNAME }}" --password-stdin
docker push emmylong1/devops-interview:v1