Skip to content

Explicitly spell out that all paths will trigger branch deployment action #589

Explicitly spell out that all paths will trigger branch deployment action

Explicitly spell out that all paths will trigger branch deployment action #589

name: Hybrid Branch Deployments
on:
pull_request:
types: [opened, synchronize, reopened, closed]
paths: # Default to deploying on any change. Change this to limit what triggers branch deployments
- "**"
env:
DAGSTER_CLOUD_URL: "https://action-demo-hybrid.dogfood.dagster.cloud"
jobs:
check_paths:
runs-on: ubuntu-20.04
outputs:
workspace_changed: ${{ steps.filter.outputs.workspace }}
steps:
- uses: actions/checkout@v2
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
workspace:
- "**" # Default to deploying on any change. Change this to limit what triggers branch deployments
parse_workspace:
needs: check_paths
if: needs.check_paths.outputs.workspace_changed == 'true'
runs-on: ubuntu-latest
outputs:
build_info: ${{ steps.parse-workspace.outputs.build_info }}
secrets_set: ${{ steps.parse-workspace.outputs.secrets_set }}
steps:
- uses: actions/checkout@v3
- name: Parse cloud workspace
id: parse-workspace
uses: ./actions/utils/parse_workspace
with:
dagster_cloud_file: sample-repo/dagster_cloud.yaml
dagster_cloud_build_push:
runs-on: ubuntu-latest
needs: parse_workspace
name: Dagster Hybrid Branch Deployments
strategy:
fail-fast: false
matrix:
location: ${{ fromJSON(needs.parse_workspace.outputs.build_info) }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.sha }}
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2
- name: Login to ECR
uses: aws-actions/amazon-ecr-login@v1
- name: Build and deploy to Dagster Cloud hybrid
uses: ./actions/hybrid_branch_deploy
with:
dagster_cloud_api_token: ${{ secrets.DAGSTER_CLOUD_HYBRID_API_TOKEN }}
location: ${{ toJson(matrix.location) }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}