Skip to content

Commit

Permalink
New CICD workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvain-morin committed Jan 24, 2024
1 parent 03e3874 commit 9b6b3a4
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 84 deletions.
63 changes: 0 additions & 63 deletions .github/workflows/CICD-dev-manual.yml

This file was deleted.

45 changes: 45 additions & 0 deletions .github/workflows/CICD-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Vision CI/CD Dev Branch

on:
push:
branches:
- '*'
- '!main'

jobs:
build-and-test:
name: Build/Test
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4

build-and-push-dev-docker-image:
name: Build/Push Dev Docker Image
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build/Push dev vision-api
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/vision-api:${{ github.ref_name }}

- name: Build/Push dev vision-cleanup
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile-cleanup
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/vision-cleanup:${{ github.ref_name }}
33 changes: 12 additions & 21 deletions .github/workflows/CI.yml → .github/workflows/CICD-main.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
name: inatVisionAPI CI
name: Vision CI/CD Main Branch

on:
push:
branches:
- main

jobs:
build-push-docker-image-vision-api:
name: Build and Push Docker Image vision-api
build-and-test:
name: Build/Test
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

build-and-push-staging-docker-image:
name: Build/Push Staging Docker Image
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4

- name: Login to Docker Hub
uses: docker/login-action@v3
Expand All @@ -21,30 +27,15 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and push
- name: Build/Push staging vision-api
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/vision-api:${{ github.sha }}

build-push-docker-image-vision-cleanup:
name: Build and Push Docker Image vision-cleanup
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and push
- name: Build/Push staging vision-cleanup
uses: docker/build-push-action@v5
with:
context: .
Expand Down

0 comments on commit 9b6b3a4

Please sign in to comment.