π: (SWCR) Request Data in FAM #647
This file contains 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 PR build' | |
on: | |
issue_comment: | |
types: [created] | |
permissions: | |
actions: read | |
issues: write | |
checks: write | |
contents: read | |
pull-requests: write | |
deployments: write | |
id-token: write | |
statuses: write | |
jobs: | |
deploy-affected-ci: | |
# only run if pull request is approved and QA is required | |
if: contains(github.event.comment.body, 'deploy test') | |
runs-on: ubuntu-latest | |
environment: ci | |
steps: | |
- uses: xt0rted/pull-request-comment-branch@v2 | |
id: comment-branch | |
- uses: actions/checkout@v4 | |
if: success() | |
with: | |
ref: ${{ steps.comment-branch.outputs.head_ref }} | |
fetch-depth: 0 | |
- name: Get fusion token | |
id: 'get-fusion-token' | |
uses: ./.github/actions/get-fusion-token | |
with: | |
client-id: ${{secrets.AZURE_CLIENT_ID}} | |
tenant-id: ${{secrets.AZURE_TENANT_ID}} | |
resource-id: ${{secrets.AZURE_RESOURCE_ID}} | |
- name: PNPM setup | |
uses: ./.github/actions/pnpm-setup | |
- name: Build monorepo | |
run: pnpm ci:build | |
- name: 'Deploy affected apps to Fusion CI' | |
shell: bash | |
env: | |
#Runs out of memory when bundling more apps otherwise even though concurrency is 1 | |
NODE_OPTIONS: '--max_old_space_size=4096' | |
run: npx turbo run pr:deploy --since origin/main --concurrency 1 -- --token ${{ steps.get-fusion-token.outputs.token }} --pr '${{ github.event.issue.number }}' --ai '${{secrets.ai}}' --sha '${{steps.comment-branch.outputs.head_sha}}' | |
- name: Comment pr | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
github.rest.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: 'Deployed! π' | |
}) |