Rebuild Dockerimage #74
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |