test #76
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: CD Pipeline | |
on: | |
push: | |
branches: [ "main", "feature/mlflow" ] | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@main | |
- name: Login to GitHub Packages | |
uses: docker/login-action@v1 | |
with: | |
registry: docker.pkg.github.com | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and Push Docker Image | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
file: ./Dockerfile | |
push: true | |
tags: docker.pkg.github.com/${{ github.repository }}/api:${{ github.sha }} | |
deploy: | |
needs: publish | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v2 | |
- name: Connect Deploy Key | |
uses: cloudtype-github-actions/connect@v1 | |
with: | |
token: ${{ secrets.CLOUDTYPE_TOKEN }} | |
ghtoken: ${{ secrets.GHP_TOKEN }} | |
- name: Deploy to Cloudtype | |
uses: cloudtype-github-actions/deploy@v1 | |
with: | |
token: ${{ secrets.CLOUDTYPE_TOKEN }} | |
project: toy_lab/review_generator | |
stage: main | |
yaml: > | |
name: ml-pipe-project | |
app: dockerfile | |
options: | |
image: ghcr.io/${{ github.repository }}/api:${{ github.sha }} | |
ports: 4000 5000 | |
commands: >- | |
poetry run python src/app.py & | |
poetry run mlflow server --host 0.0.0.0 --backend-store-uri /tmp/mlruns --no-server-artifacts & | |
context: | |
git: | |
url: [email protected]:${{ github.repository }}.git | |
ref: ${{ github.ref }} |