From 8908a3e8228d06e740711a1a43b16f6dfe72abf5 Mon Sep 17 00:00:00 2001 From: Ronan Date: Wed, 24 Apr 2024 11:26:56 +0200 Subject: [PATCH 1/4] feat(gitAction): add new gitAcion to push docker images to dockerhub --- .github/workflows/build-push-image.yml | 33 ++++++++++++++++++++++++++ Makefile | 7 +++--- 2 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/build-push-image.yml diff --git a/.github/workflows/build-push-image.yml b/.github/workflows/build-push-image.yml new file mode 100644 index 00000000..230b1a31 --- /dev/null +++ b/.github/workflows/build-push-image.yml @@ -0,0 +1,33 @@ +name: Build and Push Docker Image + +on: + pull_request: + types: [closed] + branches: + - develop + push: + branches: + - develop + +jobs: + build_and_push_image: + name: Build and Push Docker Image + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.9 + + - name: Log in to Docker Hub + run: echo "${{ secrets.DOCKERHUB_PW }}" | docker login -u "${{ secrets.DOCKERHUB_LOGIN }}" --password-stdin + + - name: Build Docker image + run: make build + + - name: Push Docker image + run: docker push pyronear/pyro-engine:latest diff --git a/Makefile b/Makefile index 0a041b8a..4d31d973 100644 --- a/Makefile +++ b/Makefile @@ -20,13 +20,14 @@ single-docs: sphinx-build docs/source docs/_build -a # Build the docker -docker: +build: docker build . -t pyronear/pyro-engine:python3.8.1-slim + docker build . -t pyronear/pyro-engine:latest # Run the engine wrapper run: docker build . -t pyronear/pyro-engine:latest - docker-compose up -d + docker compose up -d # Get log from engine wrapper log: @@ -34,4 +35,4 @@ log: # Stop the engine wrapper stop: - docker-compose down + docker compose down From 107cf935863ee86574e5f9cf2ef6c4b535c449a2 Mon Sep 17 00:00:00 2001 From: Ronan Date: Wed, 24 Apr 2024 11:30:31 +0200 Subject: [PATCH 2/4] fix(gitAction): don't even need python --- .github/workflows/build-push-image.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/build-push-image.yml b/.github/workflows/build-push-image.yml index 230b1a31..3a281b38 100644 --- a/.github/workflows/build-push-image.yml +++ b/.github/workflows/build-push-image.yml @@ -8,6 +8,7 @@ on: push: branches: - develop + - origin/rs/create-gitaction-push jobs: build_and_push_image: @@ -18,11 +19,6 @@ jobs: - name: Checkout repository uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.9 - - name: Log in to Docker Hub run: echo "${{ secrets.DOCKERHUB_PW }}" | docker login -u "${{ secrets.DOCKERHUB_LOGIN }}" --password-stdin From ac045da46782980d415a31f17078ac8a2f4aa9a5 Mon Sep 17 00:00:00 2001 From: Ronan Date: Wed, 24 Apr 2024 11:32:40 +0200 Subject: [PATCH 3/4] fix(gitAction) : name of the branch --- .github/workflows/build-push-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-push-image.yml b/.github/workflows/build-push-image.yml index 3a281b38..0a3b6ca5 100644 --- a/.github/workflows/build-push-image.yml +++ b/.github/workflows/build-push-image.yml @@ -8,7 +8,7 @@ on: push: branches: - develop - - origin/rs/create-gitaction-push + - rs/create-gitaction-push jobs: build_and_push_image: From c4314613ea8123d01500c126559baad6a756cc76 Mon Sep 17 00:00:00 2001 From: Ronan Date: Wed, 24 Apr 2024 11:35:24 +0200 Subject: [PATCH 4/4] refactor(gitAction): cleanup name branch --- .github/workflows/build-push-image.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build-push-image.yml b/.github/workflows/build-push-image.yml index 0a3b6ca5..bead751c 100644 --- a/.github/workflows/build-push-image.yml +++ b/.github/workflows/build-push-image.yml @@ -8,7 +8,6 @@ on: push: branches: - develop - - rs/create-gitaction-push jobs: build_and_push_image: