name: Deploy Pull Request

on:
  pull_request_target:
    types: [labeled]

env:
  COVERAGE: false

jobs:
  deploy:
    name: Deploy PR Preview
    runs-on: ubuntu-latest
    if: contains(github.event.pull_request.labels.*.name, 'safe to deploy')
    steps:
    - uses: actions/checkout@v3
      with:
        ref: ${{ github.event.pull_request.head.sha }}
    - name: Use Node.js 16
      uses: actions/setup-node@v3
      with:
        node-version: 16
        cache: 'npm'
    - name: install dependencies
      run: npm ci
    - name: Ember CLI Deploy
      run: node_modules/.bin/ember deploy pr-preview
      env:
        AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
        AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
        GITHUB_PR_NUMBER: ${{ github.event.number }}
  comment:
    runs-on: ubuntu-latest
    needs: deploy
    steps:
      - uses: actions/github-script@v5
        with:
          github-token: ${{secrets.GITHUB_TOKEN}}
          script: |
            github.rest.issues.createComment({
              issue_number: context.issue.number,
              owner: context.repo.owner,
              repo: context.repo.repo,
              body: "Staging build deployed! It can be accessed with `bin/console ilios:update-frontend --staging-build --at-version=pr_preview-${{ github.event.number }}`"
            })
name: Deploy Pull Request

on:
  pull_request_target:
    types: [labeled]

env:
  COVERAGE: false

jobs:
  deploy:
    name: Deploy PR Preview
    runs-on: ubuntu-latest
    if: contains(github.event.pull_request.labels.*.name, 'safe to deploy')
    steps:
    - uses: actions/checkout@v3
      with:
        ref: ${{ github.event.pull_request.head.sha }}
    - name: Use Node.js 16
      uses: actions/setup-node@v3
      with:
        node-version: 16
        cache: 'npm'
    - name: install dependencies
      run: npm ci
    - name: Ember CLI Deploy
      run: node_modules/.bin/ember deploy pr-preview
      env:
        AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
        AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
        GITHUB_PR_NUMBER: ${{ github.event.number }}
  comment:
    runs-on: ubuntu-latest
    needs: deploy
    steps:
      - uses: actions/github-script@v6
        with:
          github-token: ${{secrets.GITHUB_TOKEN}}
          script: |
            github.rest.issues.createComment({
              issue_number: context.issue.number,
              owner: context.repo.owner,
              repo: context.repo.repo,
              body: "Staging build deployed! It can be accessed with `bin/console ilios:update-frontend --staging-build --at-version=pr_preview-${{ github.event.number }}`"
            })
Bump actions/github-script from 5 to 6
Bump actions/github-script from 5 to 6

Bumps [actions/github-script](https://github.com/actions/github-script) from 5 to 6.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@github.com>