From b65f4f5bcef2aca7df20ad3ed425f6a47b905711 Mon Sep 17 00:00:00 2001 From: Ben Pankow Date: Thu, 8 Dec 2022 18:23:10 -0800 Subject: [PATCH 1/3] [workflow] Add workflow_dispatch manual trigger --- .github/workflows/deploy.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 7ba4d3a..e4376b7 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,5 +1,6 @@ name: Serverless Prod Deployment on: + workflow_dispatch: {} push: branches: - "main" From bb7849cd167dd693567708c5b54848882cb6d805 Mon Sep 17 00:00:00 2001 From: benpankow Date: Thu, 8 Dec 2022 18:25:30 -0800 Subject: [PATCH 2/3] add other workflow for now --- .github/workflows/test_other_workflow.yml | 73 +++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 .github/workflows/test_other_workflow.yml diff --git a/.github/workflows/test_other_workflow.yml b/.github/workflows/test_other_workflow.yml new file mode 100644 index 0000000..cfa1509 --- /dev/null +++ b/.github/workflows/test_other_workflow.yml @@ -0,0 +1,73 @@ +name: Serverless Prod Deployment 2 +on: + workflow_dispatch: {} + push: + branches: + - "benpankow-manual-trigger" + - "master" +concurrency: + # Cancel in-progress deploys to main branch + group: ${{ github.ref }} + cancel-in-progress: true +env: + DAGSTER_CLOUD_URL: ${{ secrets.DAGSTER_CLOUD_URL }} + 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_prod_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 }} + From e96b820c7805b4a9e7cd73c3b00717c7d1e05e0f Mon Sep 17 00:00:00 2001 From: benpankow Date: Thu, 8 Dec 2022 18:28:58 -0800 Subject: [PATCH 3/3] remove test workflow --- .github/workflows/test_other_workflow.yml | 73 ----------------------- 1 file changed, 73 deletions(-) delete mode 100644 .github/workflows/test_other_workflow.yml diff --git a/.github/workflows/test_other_workflow.yml b/.github/workflows/test_other_workflow.yml deleted file mode 100644 index cfa1509..0000000 --- a/.github/workflows/test_other_workflow.yml +++ /dev/null @@ -1,73 +0,0 @@ -name: Serverless Prod Deployment 2 -on: - workflow_dispatch: {} - push: - branches: - - "benpankow-manual-trigger" - - "master" -concurrency: - # Cancel in-progress deploys to main branch - group: ${{ github.ref }} - cancel-in-progress: true -env: - DAGSTER_CLOUD_URL: ${{ secrets.DAGSTER_CLOUD_URL }} - 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_prod_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 }} -