CI/CD Pipeline #28
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: CI/CD Pipeline | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
schedule: | |
- cron: '00 12 */15 * *' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Install Python and pip | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y python3 python3-pip | |
- name: Install Docker Engine | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | |
sudo apt-get update | |
sudo apt-get install -y docker-ce docker-ce-cli containerd.io | |
- name: Install dependencies | |
run: | | |
cd regression_problems/predict_real_estate_prices_in_california | |
ls | |
pip install -r docker/requirements.txt | |
- name: Buil model | |
run: | | |
ls | |
cd regression_problems/predict_real_estate_prices_in_california/software_engineering_data_science | |
python main.py | |
ls | |
- name: Build Docker image | |
run: | | |
ls | |
cd regression_problems/predict_real_estate_prices_in_california | |
docker build -t real_estate_app . | |
- name: Push to Docker Hub | |
run: | | |
ls | |
cd regression_problems/predict_real_estate_prices_in_california | |
echo "${{ secrets.DOCKER_HUB_PASSWORD }}" | docker login --username "${{ secrets.DOCKER_HUB_USERNAME }}" --password-stdin | |
docker tag real_estate_app:latest ${{ secrets.DOCKER_HUB_USERNAME }}/real_estate_app:latest | |
docker push ${{ secrets.DOCKER_HUB_USERNAME }}/real_estate_app:latest |