From 06ffa6d7da8ba683abeda22c309345f8e4b20ad5 Mon Sep 17 00:00:00 2001 From: Carolin Stolpe <8385345+castolpe@users.noreply.github.com> Date: Thu, 7 Nov 2024 13:59:02 +0100 Subject: [PATCH] Add workflow to update fastapi image --- .github/workflows/rebuild_docker_image.yml | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/rebuild_docker_image.yml diff --git a/.github/workflows/rebuild_docker_image.yml b/.github/workflows/rebuild_docker_image.yml new file mode 100644 index 0000000..494e98f --- /dev/null +++ b/.github/workflows/rebuild_docker_image.yml @@ -0,0 +1,26 @@ +name: Rebuild Dockerimage +on: + workflow_run: + workflows: ["Run data pipeline"] + types: + - completed + workflow_dispatch: + +jobs: + run-dvc-pipeline: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + + - name: Log in to Docker Hub + run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin + + - name: Build Docker Image + run: docker build -t ${{ secrets.DOCKER_USERNAME }}/fastapi:latest . + + - name: Push Docker Image to Docker Hub + run: docker push ${{ secrets.DOCKER_USERNAME }}/fastapi:latest + + - name: Log out of Docker Hub + run: docker logout