splited the cicd workflow #1
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: build & push img | ||
on: | ||
workflow_run: | ||
workflows: ['pull latest prod model'] | ||
types: | ||
- completed | ||
jobs: | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
build-nd-push-docker-image: | ||
name: build & push img to dockerhub | ||
needs: pull-latest-model # previous stage must be successfully completed (job dependency) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Print Current Directory be-down # for debug purpose | ||
run: ls /home/runner/work/cicd-aws/cicd-aws | ||
- name: Download Model Artifacts # download the previously saved artifacts | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: model | ||
path: /home/runner/work/cicd-aws/cicd-aws | ||
- name: Print Current Directory af-down # for debugging | ||
run: ls /home/runner/work/cicd-aws/cicd-aws | ||
# push img to docker hub | ||
- name: Build Docker Image | ||
run: | | ||
docker build -t ${{ secrets.DOCKER_USERNAME }}/wineqcicdaws:latest . | ||
- name: Log-in to Docker Hub | ||
run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Push Docker Img # push the previously built img to dockerhub | ||
run: docker push ${{ secrets.DOCKER_USERNAME }}/wineqcicdaws:latest |