Skip to content

Rebuild Dockerimage #72

Rebuild Dockerimage

Rebuild Dockerimage #72

name: Rebuild Dockerimage
on:
workflow_run:
workflows: ["Run data pipeline"]
types:
- completed
workflow_dispatch:
jobs:
rebuild-docker-image:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup DVC
uses: iterative/setup-dvc@v1
with:
version: '3.56.0'
- name: Pull data from remote storage
env:
DVC_ACCESS_KEY: ${{ secrets.DVC_ACCESS_KEY }}
run: |
dvc remote modify origin --local access_key_id $DVC_ACCESS_KEY
dvc remote modify origin --local secret_access_key $DVC_ACCESS_KEY
dvc pull
- 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 -f Dockerfile.api -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