diff --git a/.github/workflows/main.yml b/.github/workflows/cd.yml similarity index 50% rename from .github/workflows/main.yml rename to .github/workflows/cd.yml index a249839..3ae7e51 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/cd.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..66ee7ea --- /dev/null +++ b/.github/workflows/ci.yml @@ -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