fix(ci): add deployment so it shows up as deployed in PR

This commit is contained in:
Rickard Andersson 2023-08-23 21:53:03 +03:00
parent 31197c1f71
commit 1e27bc64cf

View File

@ -73,6 +73,26 @@ jobs:
repo: context.repo.repo,
body: `Deployed to ${deploymentUrl}`,
});
- name: Add deployment to PR
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const fs = require('fs');
const deploymentUrl = fs.readFileSync('_vercel-deployment-url', 'utf8');
await github.rest.repos.createDeployment({
owner: context.repo.owner,
repo: context.repo.repo,
ref: context.sha,
environment: 'preview',
transient_environment: true,
required_contexts: [],
auto_merge: false,
production_environment: false,
payload: JSON.stringify({
deploymentUrl,
}),
});
interaction-and-and-accessibility:
runs-on: ubuntu-latest