Build and Deploy #2
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 and Deploy | |
on: [workflow_dispatch] | |
env: | |
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} | |
jobs: | |
build: | |
name: Build and Push Cog Image | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: superfly/flyctl-actions/setup-flyctl@master | |
- uses: replicate/setup-cog@v1 | |
with: | |
install-cuda: false | |
cog-version: v0.9.4 | |
- run: flyctl auth docker | |
- id: getApp | |
run: echo "APP_NAME=$(flyctl status --json | jq -r .ID)" >> $GITHUB_ENV | |
- run: cog push registry.fly.io/${{ env.APP_NAME }}:latest --use-cuda-base-image false | |
deploy: | |
name: Deploy Cog to Fly | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: superfly/flyctl-actions/setup-flyctl@master | |
- run: flyctl deploy |