Skip to content

Deploy

Deploy #11

Workflow file for this run

name: Deploy
on:
push:
branches:
- 'main'
workflow_dispatch:
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: gcloud Auth
id: auth
uses: "google-github-actions/auth@v0"
with:
credentials_json: ${{ secrets.GCP_SERVICE_TOKEN }}
token_format: 'access_token'
- name: Login to gcr
run: |
echo "${{ steps.auth.outputs.access_token }}" | docker login -u oauth2accesstoken --password-stdin https://gcr.io
- name: Build and Push
run: |
docker build -f Dockerfile -t gcr.io/slack-diffusion/slack-diffusion .
docker tag gcr.io/slack-diffusion/slack-diffusion gcr.io/slack-diffusion/slack-diffusion:latest
docker tag gcr.io/slack-diffusion/slack-diffusion gcr.io/slack-diffusion/slack-diffusion:${{ github.sha }}
docker push gcr.io/slack-diffusion/slack-diffusion
docker push gcr.io/slack-diffusion/slack-diffusion:latest
docker push gcr.io/slack-diffusion/slack-diffusion:${{ github.sha }}
- name: Deploy
uses: "google-github-actions/deploy-cloudrun@v1"
with:
project_id: slack-diffusion
region: australia-southeast2
env_vars: |
PROJECT_ID=slack-diffusion
API_HOST="https://api.stability.ai"
HEIGHT=640
WIDTH=640
secrets: |
SLACK_CLIENT_ID=SLACK_CLIENT_ID:latest
SLACK_CLIENT_SECRET=SLACK_CLIENT_SECRET:latest
SLACK_SIGNING_SECRET=SLACK_SIGNING_SECRET:latest
SLACK_TOKEN=SLACK_TOKEN:latest
STABILITY_API_KEY=STABILITY_API_KEY:latest
service: slack-diffusion
image: gcr.io/slack-diffusion/slack-diffusion:${{ github.sha }}