-
Notifications
You must be signed in to change notification settings - Fork 2
70 lines (64 loc) · 2.4 KB
/
branch_deployments.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Serverless Branch Deployments
on:
pull_request:
types: [opened, synchronize, reopened, closed]
concurrency:
# Cancel in-progress runs on same branch
group: ${{ github.ref }}
cancel-in-progress: true
env:
DAGSTER_CLOUD_URL: "http://ziwei.dagster.cloud"
DAGSTER_CLOUD_API_TOKEN: ${{ secrets.DAGSTER_CLOUD_API_TOKEN }}
ENABLE_FAST_DEPLOYS: 'true'
jobs:
dagster_cloud_default_deploy:
name: Dagster Serverless Deploy
runs-on: ubuntu-latest
outputs:
build_info: ${{ steps.parse-workspace.outputs.build_info }}
steps:
- name: Parse cloud workspace
if: env.ENABLE_FAST_DEPLOYS != 'true'
id: parse-workspace
uses: dagster-io/dagster-cloud-action/actions/utils/parse_workspace@v0.1
with:
dagster_cloud_file: dagster_cloud.yaml
- name: Checkout
if: env.ENABLE_FAST_DEPLOYS == 'true'
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
path: project-repo
- name: Build and deploy Python executable
if: env.ENABLE_FAST_DEPLOYS == 'true'
uses: dagster-io/dagster-cloud-action/actions/build_deploy_python_executable@pex-v0.1
with:
dagster_cloud_file: "$GITHUB_WORKSPACE/project-repo/dagster_cloud.yaml"
build_output_dir: "$GITHUB_WORKSPACE/build"
python_version: "3.8"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
dagster_cloud_docker_deploy:
name: Dagster Serverless Docker Deploy
runs-on: ubuntu-latest
if: needs.dagster_cloud_default_deploy.outputs.build_info
needs: dagster_cloud_default_deploy
strategy:
fail-fast: false
matrix:
location: ${{ fromJSON(needs.dagster_cloud_default_deploy.outputs.build_info) }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- name: Build and deploy to Dagster Cloud serverless
uses: dagster-io/dagster-cloud-action/actions/serverless_branch_deploy@v0.1
with:
dagster_cloud_api_token: ${{ secrets.DAGSTER_CLOUD_API_TOKEN }}
location: ${{ toJson(matrix.location) }}
# Uncomment to pass through Github Action secrets as a JSON string of key-value pairs
# env_vars: ${{ toJson(secrets) }}
organization_id: ${{ secrets.ORGANIZATION_ID }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}