From 8a512c4ac522c14462a104a00a64e4c15f960a93 Mon Sep 17 00:00:00 2001 From: Melisa Anabella Rossi Date: Wed, 22 Nov 2023 16:01:51 -0300 Subject: [PATCH] feat: add deployment by path (#302) --- .../workflows/set-rollout-by-path-manual.yaml | 7 +-- .github/workflows/set-rollout-by-path.yaml | 50 +++++++++++++++++++ 2 files changed, 54 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/set-rollout-by-path.yaml diff --git a/.github/workflows/set-rollout-by-path-manual.yaml b/.github/workflows/set-rollout-by-path-manual.yaml index 3e448d2..b79c100 100644 --- a/.github/workflows/set-rollout-by-path-manual.yaml +++ b/.github/workflows/set-rollout-by-path-manual.yaml @@ -7,14 +7,15 @@ on: description: "NPM Version of the release (@dcl/profile-site)" required: true default: "" - deploymentDomain: + deploymentEnvironment: type: "choice" - description: "Deployment domain" + description: "Deployment environment" required: true default: "zone" options: - zone - today + - org rolloutPercentage: description: "The percentage for this rollout" required: true @@ -40,6 +41,6 @@ jobs: # Rollout information deploymentPath: "profile" - deploymentEnvironment: ${{ github.event.inputs.deploymentDomain }} + deploymentEnvironment: ${{ github.event.inputs.deploymentEnvironment }} deploymentName: "_site" percentage: ${{ github.event.inputs.rolloutPercentage }} diff --git a/.github/workflows/set-rollout-by-path.yaml b/.github/workflows/set-rollout-by-path.yaml new file mode 100644 index 0000000..9f7902d --- /dev/null +++ b/.github/workflows/set-rollout-by-path.yaml @@ -0,0 +1,50 @@ +name: Set rollout by path + +on: [deployment_status] + +jobs: + set-rollout: + if: ${{ github.event.deployment.task == 'upload-to-cdn' && github.event.deployment_status.state == 'success' }} + runs-on: ubuntu-latest + steps: + - uses: hmarr/debug-action@v2 + + # Dev + - name: Set Rollout - Development + uses: decentraland/set-rollout-action@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + + # Repo deployment info + ref: ${{ github.event.deployment.ref }} + sha: ${{ github.event.deployment.sha }} + + # CDN information + packageName: ${{ github.event.deployment.payload.packageName }} + packageVersion: ${{ github.event.deployment.payload.packageVersion }} + + # Rollout information + deploymentPath: 'profile' + deploymentEnvironment: 'zone' + deploymentName: '_site' + percentage: 100 + + # Stg + - name: Set Rollout - Staging + uses: decentraland/set-rollout-action@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + + # Repo deployment info + ref: ${{ github.event.deployment.ref }} + sha: ${{ github.event.deployment.sha }} + + # CDN information + packageName: ${{ github.event.deployment.payload.packageName }} + packageVersion: ${{ github.event.deployment.payload.packageVersion }} + + # Rollout information + deploymentPath: 'profile' + deploymentEnvironment: 'today' + deploymentName: '_site' + percentage: 100