fix: update DSM span tag name #205
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy Pricing Service | |
| on: | |
| push: | |
| paths: | |
| - src/pricing-service/** | |
| branches: | |
| - "main" | |
| pull_request: | |
| paths: | |
| - src/pricing-service/** | |
| branches: | |
| - "main" | |
| types: [opened, synchronize, reopened] | |
| workflow_dispatch: | |
| permissions: | |
| id-token: write | |
| contents: read | |
| jobs: | |
| verify-workshop-build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| cache: 'npm' | |
| cache-dependency-path: src/pricing-service/package-lock.json | |
| - name: Verify workshop stubs compile | |
| shell: bash | |
| run: | | |
| cd src/pricing-service | |
| make workshop-build | |
| - name: Install dependencies | |
| run: | | |
| cd src/pricing-service | |
| npm ci | |
| - name: Run unit tests | |
| run: | | |
| cd src/pricing-service | |
| npm test | |
| - name: Type check | |
| run: | | |
| cd src/pricing-service | |
| npm run typecheck | |
| deploy-tf: | |
| runs-on: ubuntu-latest | |
| needs: verify-workshop-build | |
| concurrency: | |
| group: tf-pricing-service | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Terraform | |
| uses: hashicorp/setup-terraform@v2 | |
| - name: Set up Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| cache: 'npm' | |
| cache-dependency-path: src/pricing-service/package-lock.json | |
| - name: Configure AWS credentials | |
| uses: aws-actions/configure-aws-credentials@b47578312673ae6fa5b5096b330d9fbac3d116df | |
| with: | |
| role-to-assume: ${{ secrets.AWS_ROLE_ARN }} | |
| role-session-name: GitHub_to_AWS_via_FederatedOIDC | |
| aws-region: ${{ vars.TF_AWS_REGION }} | |
| - name: Set Commit Hash Environment Variables | |
| shell: bash | |
| run: | | |
| echo "sha_short=$(git rev-parse --short "$GITHUB_SHA")" >> "$GITHUB_ENV" | |
| - name: Build | |
| shell: bash | |
| env: | |
| COMMIT_HASH: ${{ env.sha_short }} | |
| ENV: "dev" | |
| DD_API_KEY: ${{secrets.DD_API_KEY}} | |
| DD_SITE: ${{ vars.DD_SITE }} | |
| AWS_REGION: ${{ vars.TF_AWS_REGION }} | |
| run: | | |
| cd src/pricing-service | |
| make build | |
| - name: Deploy to ephemeral environment | |
| shell: bash | |
| env: | |
| COMMIT_HASH: ${{ env.sha_short }} | |
| ENV: "tf-${{ env.sha_short }}" | |
| DD_API_KEY: ${{secrets.DD_API_KEY}} | |
| DD_SITE: ${{ vars.DD_SITE }} | |
| AWS_REGION: ${{ vars.TF_AWS_REGION }} | |
| TF_STATE_BUCKET_NAME: ${{secrets.TF_STATE_BUCKET_NAME}} | |
| run: | | |
| cd src/pricing-service | |
| make tf-apply | |
| - name: Integration test ephemeral environment | |
| shell: bash | |
| env: | |
| ENV: "tf-${{ env.sha_short }}" | |
| AWS_REGION: ${{ vars.TF_AWS_REGION }} | |
| run: | | |
| cd src/pricing-service | |
| make integration-test | |
| - name: Destroy ephemeral environment | |
| shell: bash | |
| if: always() | |
| env: | |
| COMMIT_HASH: ${{ env.sha_short }} | |
| ENV: "tf-${{ env.sha_short }}" | |
| DD_API_KEY: ${{secrets.DD_API_KEY}} | |
| DD_SITE: ${{ vars.DD_SITE }} | |
| AWS_REGION: ${{ vars.TF_AWS_REGION }} | |
| TF_STATE_BUCKET_NAME: ${{secrets.TF_STATE_BUCKET_NAME}} | |
| run: | | |
| cd src/pricing-service | |
| make tf-destroy | |
| - name: Deploy to dev | |
| if: github.event_name == 'push' | |
| shell: bash | |
| env: | |
| COMMIT_HASH: ${{ env.sha_short }} | |
| ENV: "dev" | |
| DD_API_KEY: ${{secrets.DD_API_KEY}} | |
| DD_SITE: ${{ vars.DD_SITE }} | |
| AWS_REGION: ${{ vars.TF_AWS_REGION }} | |
| TF_STATE_BUCKET_NAME: ${{secrets.TF_STATE_BUCKET_NAME}} | |
| run: | | |
| cd src/pricing-service | |
| make tf-apply | |
| - name: Integration test dev | |
| if: github.event_name == 'push' | |
| shell: bash | |
| env: | |
| ENV: "dev" | |
| AWS_REGION: ${{ vars.TF_AWS_REGION }} | |
| run: | | |
| cd src/pricing-service | |
| make integration-test | |
| - name: Destroy dev | |
| shell: bash | |
| if: always() | |
| env: | |
| COMMIT_HASH: ${{ env.sha_short }} | |
| ENV: "dev" | |
| DD_API_KEY: ${{secrets.DD_API_KEY}} | |
| DD_SITE: ${{ vars.DD_SITE }} | |
| AWS_REGION: ${{ vars.TF_AWS_REGION }} | |
| TF_STATE_BUCKET_NAME: ${{secrets.TF_STATE_BUCKET_NAME}} | |
| run: | | |
| cd src/pricing-service | |
| make tf-destroy | |
| deploy-cdk: | |
| runs-on: ubuntu-latest | |
| needs: verify-workshop-build | |
| concurrency: | |
| group: cdk-pricing-service | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| cache: 'npm' | |
| cache-dependency-path: src/pricing-service/package-lock.json | |
| - name: Install CDK | |
| run: | | |
| npm install -g aws-cdk | |
| - name: Configure AWS credentials | |
| uses: aws-actions/configure-aws-credentials@b47578312673ae6fa5b5096b330d9fbac3d116df | |
| with: | |
| role-to-assume: ${{ secrets.AWS_ROLE_ARN }} | |
| role-session-name: GitHub_to_AWS_via_FederatedOIDC | |
| aws-region: ${{ vars.CDK_AWS_REGION }} | |
| - name: Set Commit Hash Environment Variables | |
| shell: bash | |
| run: | | |
| echo "sha_short=$(git rev-parse --short "$GITHUB_SHA")" >> "$GITHUB_ENV" | |
| - name: Build | |
| shell: bash | |
| env: | |
| COMMIT_HASH: ${{ env.sha_short }} | |
| ENV: "dev" | |
| DD_API_KEY: ${{secrets.DD_API_KEY}} | |
| DD_SITE: ${{ vars.DD_SITE }} | |
| AWS_REGION: ${{ vars.CDK_PROD_AWS_REGION }} | |
| run: | | |
| cd src/pricing-service | |
| make build | |
| - name: Deploy to ephemeral environment | |
| shell: bash | |
| env: | |
| COMMIT_HASH: ${{ env.sha_short }} | |
| ENV: "cdk-${{ env.sha_short }}" | |
| DD_API_KEY: ${{secrets.DD_API_KEY}} | |
| DD_SITE: ${{ vars.DD_SITE }} | |
| AWS_REGION: ${{ vars.CDK_AWS_REGION }} | |
| run: | | |
| cd src/pricing-service | |
| make cdk-deploy | |
| - name: Integration test ephemeral environment | |
| shell: bash | |
| env: | |
| ENV: "cdk-${{ env.sha_short }}" | |
| AWS_REGION: ${{ vars.CDK_AWS_REGION }} | |
| run: | | |
| cd src/pricing-service | |
| make integration-test | |
| - name: Destroy ephemeral environment | |
| shell: bash | |
| if: always() | |
| env: | |
| COMMIT_HASH: ${{ env.sha_short }} | |
| ENV: "cdk-${{ env.sha_short }}" | |
| DD_API_KEY: ${{secrets.DD_API_KEY}} | |
| DD_SITE: ${{ vars.DD_SITE }} | |
| run: | | |
| cd src/pricing-service | |
| make cdk-destroy | |
| - name: Deploy to dev | |
| if: github.event_name == 'push' | |
| shell: bash | |
| env: | |
| COMMIT_HASH: ${{ env.sha_short }} | |
| ENV: "dev" | |
| DD_API_KEY: ${{secrets.DD_API_KEY}} | |
| DD_SITE: ${{ vars.DD_SITE }} | |
| run: | | |
| cd src/pricing-service | |
| make cdk-deploy | |
| - name: Integration test dev | |
| if: github.event_name == 'push' | |
| shell: bash | |
| env: | |
| ENV: "dev" | |
| AWS_REGION: ${{ vars.CDK_AWS_REGION }} | |
| run: | | |
| cd src/pricing-service | |
| make integration-test | |
| - name: Destroy dev | |
| shell: bash | |
| if: always() | |
| env: | |
| COMMIT_HASH: ${{ env.sha_short }} | |
| ENV: "dev" | |
| DD_API_KEY: ${{secrets.DD_API_KEY}} | |
| DD_SITE: ${{ vars.DD_SITE }} | |
| run: | | |
| cd src/pricing-service | |
| make cdk-destroy | |
| deploy-cdk-prod: | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'push' | |
| needs: deploy-cdk | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| cache: 'npm' | |
| cache-dependency-path: src/pricing-service/package-lock.json | |
| - name: Install CDK | |
| run: | | |
| npm install -g aws-cdk | |
| - name: Configure AWS credentials | |
| uses: aws-actions/configure-aws-credentials@b47578312673ae6fa5b5096b330d9fbac3d116df | |
| with: | |
| role-to-assume: ${{ secrets.PRODUCTION_AWS_ROLE_ARN }} | |
| role-session-name: GitHub_to_AWS_via_FederatedOIDC | |
| aws-region: ${{ vars.CDK_PROD_AWS_REGION }} | |
| - name: Set Commit Hash Environment Variables | |
| shell: bash | |
| run: | | |
| echo "sha_short=$(git rev-parse --short "$GITHUB_SHA")" >> "$GITHUB_ENV" | |
| - name: Build | |
| shell: bash | |
| env: | |
| COMMIT_HASH: ${{ env.sha_short }} | |
| ENV: "prod" | |
| DD_API_KEY: ${{secrets.DD_API_KEY}} | |
| DD_SITE: ${{ vars.DD_SITE }} | |
| AWS_REGION: ${{ vars.CDK_PROD_AWS_REGION }} | |
| run: | | |
| cd src/pricing-service | |
| make build | |
| - name: Deploy to prod | |
| shell: bash | |
| env: | |
| COMMIT_HASH: ${{ env.sha_short }} | |
| ENV: "prod" | |
| DD_API_KEY: ${{secrets.DD_API_KEY}} | |
| DD_SITE: ${{ vars.DD_SITE }} | |
| run: | | |
| cd src/pricing-service | |
| make cdk-deploy | |
| - name: Integration test ephemeral environment | |
| shell: bash | |
| env: | |
| ENV: "prod" | |
| AWS_REGION: ${{ vars.CDK_PROD_AWS_REGION }} | |
| run: | | |
| cd src/pricing-service | |
| make integration-test | |
| deploy-sam: | |
| runs-on: ubuntu-latest | |
| needs: verify-workshop-build | |
| concurrency: | |
| group: sam-pricing-service | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| cache: 'npm' | |
| cache-dependency-path: src/pricing-service/package-lock.json | |
| - uses: aws-actions/setup-sam@v1 | |
| - name: Configure AWS credentials | |
| uses: aws-actions/configure-aws-credentials@b47578312673ae6fa5b5096b330d9fbac3d116df | |
| with: | |
| role-to-assume: ${{ secrets.AWS_ROLE_ARN }} | |
| role-session-name: GitHub_to_AWS_via_FederatedOIDC | |
| aws-region: ${{ vars.SAM_AWS_REGION }} | |
| - name: Set Commit Hash Environment Variables | |
| shell: bash | |
| run: | | |
| echo "sha_short=$(git rev-parse --short "$GITHUB_SHA")" >> "$GITHUB_ENV" | |
| - name: Build | |
| shell: bash | |
| env: | |
| COMMIT_HASH: ${{ env.sha_short }} | |
| ENV: "dev" | |
| DD_API_KEY: ${{secrets.DD_API_KEY}} | |
| DD_SITE: ${{ vars.DD_SITE }} | |
| AWS_REGION: ${{ vars.CDK_PROD_AWS_REGION }} | |
| run: | | |
| cd src/pricing-service | |
| make build | |
| - name: Deploy to ephemeral environment | |
| shell: bash | |
| env: | |
| COMMIT_HASH: ${{ env.sha_short }} | |
| ENV: "sam-${{ env.sha_short }}" | |
| DD_API_KEY: ${{secrets.DD_API_KEY}} | |
| DD_SITE: ${{ vars.DD_SITE }} | |
| AWS_REGION: ${{ vars.SAM_AWS_REGION }} | |
| run: | | |
| cd src/pricing-service | |
| make sam | |
| - name: Integration test ephemeral environment | |
| shell: bash | |
| env: | |
| ENV: "sam-${{ env.sha_short }}" | |
| AWS_REGION: ${{ vars.SAM_AWS_REGION }} | |
| run: | | |
| cd src/pricing-service | |
| make integration-test | |
| - name: Destroy ephemeral environment | |
| shell: bash | |
| if: always() | |
| env: | |
| COMMIT_HASH: ${{ env.sha_short }} | |
| ENV: "sam-${{ env.sha_short }}" | |
| DD_API_KEY: ${{secrets.DD_API_KEY}} | |
| DD_SITE: ${{ vars.DD_SITE }} | |
| AWS_REGION: ${{ vars.SAM_AWS_REGION }} | |
| run: | | |
| cd src/pricing-service | |
| make sam-destroy | |
| - name: Deploy to dev | |
| if: github.event_name == 'push' | |
| shell: bash | |
| env: | |
| COMMIT_HASH: ${{ env.sha_short }} | |
| ENV: "dev" | |
| DD_API_KEY: ${{secrets.DD_API_KEY}} | |
| DD_SITE: ${{ vars.DD_SITE }} | |
| AWS_REGION: ${{ vars.SAM_AWS_REGION }} | |
| run: | | |
| cd src/pricing-service | |
| make sam | |
| - name: Integration test dev | |
| if: github.event_name == 'push' | |
| shell: bash | |
| env: | |
| ENV: "dev" | |
| AWS_REGION: ${{ vars.SAM_AWS_REGION }} | |
| run: | | |
| cd src/pricing-service | |
| make integration-test | |
| - name: Destroy dev | |
| shell: bash | |
| if: always() | |
| env: | |
| COMMIT_HASH: ${{ env.sha_short }} | |
| ENV: "dev" | |
| DD_API_KEY: ${{secrets.DD_API_KEY}} | |
| DD_SITE: ${{ vars.DD_SITE }} | |
| AWS_REGION: ${{ vars.SAM_AWS_REGION }} | |
| run: | | |
| cd src/pricing-service | |
| make sam-destroy |