Skip to content

Commit

Permalink
separate workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jossefaz committed Apr 25, 2021
1 parent 383ad20 commit 73ed025
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 19 deletions.
24 changes: 5 additions & 19 deletions .github/workflows/main.yml → .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,19 @@
name: CI

name: Publish Docker image
on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:

release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: build
run: docker-compose up -d --build
- name: test
run: docker-compose exec -T web pytest
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@master
uses: actions/checkout@v2
- name: Push to Docker Hub
uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
dockerfile: ./src/Dockerfile
constext : ./src
repository: nessgis/users-api
tag_with_ref: true
tag_with_ref: true
18 changes: 18 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: CI

on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: build
run: docker-compose up -d --build
- name: test
run: docker-compose exec -T web pytest

0 comments on commit 73ed025

Please sign in to comment.