Deploy PR build #12
Workflow file for this run
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: | |
pull_request: | |
branches: | |
- main | |
pull_request_review: | |
types: ['submitted'] | |
permissions: write-all | |
jobs: | |
aquire-token: | |
if: contains(github.event.pull_request.labels.*.name, 'QA Required') && github.event.review.state == 'approved' | |
runs-on: ubuntu-latest | |
steps: | |
- name: 'Login to Azure' | |
uses: azure/login@v1 | |
with: | |
client-id: ${{ secrets.AZURE_CLIENT_ID }} | |
tenant-id: ${{ secrets.AZURE_TENANT_ID }} | |
allow-no-subscriptions: true | |
- name: 'Obtain token for upload' | |
shell: bash | |
run: echo "FUSION_TOKEN=$(az account get-access-token --resource '${{ secrets.AZURE_RESOURCE_ID }}' | jq '.accessToken')" >> $GITHUB_ENV | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # Required to fetch range | |
- name: Install Dependencies | |
run: npm i -g pnpm typescript && pnpm i | |
- name: Build monorepo | |
run: pnpm ci:build | |
- name: 'Deploy affected apps to Fusion' | |
shell: bash | |
run: npx turbo run pr:deploy --since origin/main -- --token ${{ env.FUSION_TOKEN }} --pr ${{ github.event.number }} |