Skip to content

Commit

Permalink
Setup CI deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
cc-a committed Apr 3, 2024
1 parent 1c629ff commit cebb463
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: CI
on: push
jobs:
build-and-publish:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get image metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository }}
- name: install requirements
run: pip install -r requirements.txt
- name: deploy
run: python deploy.py ${{steps.meta.outputs.tags }}

# - name: Build and push Docker image
# uses: docker/build-push-action@v4
# with:
# context: .
# push: true
# tags: ${{steps.meta.outputs.tags }}
13 changes: 13 additions & 0 deletions deploy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import sys
from hello_world import my_flow

image = sys.argv[1]

my_flow.deploy(
name="my-docker-deployment",
work_pool_name="Test",
tags=["onboarding"],
parameters={"value": 1},
interval=60,
image=image,
)
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
prefect==2.16.8

0 comments on commit cebb463

Please sign in to comment.