Skip to content

Update README.md

Update README.md #76

name: PR Preview
on: pull_request
jobs:
deploy-pr-preview:
runs-on: ubuntu-latest
steps:
- name: Set up token
id: token
# This is a base64-encoded OAuth token for the "konveyor-preview-bot" GitHub account, which has no secure access.
run: echo "::set-output name=GH_TOKEN::`echo 'ODk3MzkyNzJlMDQwZjQ3YThhODJjYjYwZmFhM2RlOWQ3ZTk2YWM3OQo=' | base64 -d`"
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: "16"
- name: Install dependencies
run: npm install --force
- name: Build
run: npm run build
- name: Generate Surge URL
uses: actions/github-script@v3
id: surge-url
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { issue: { number: issue_number } } = context;
return `windup-website-pr-${issue_number}-preview.surge.sh`;
result-encoding: string
- name: Install Surge
run: npm install -g surge
- name: Deploy to Surge
run: surge ./public/ "${{steps.surge-url.outputs.result}}" --token 62bd7a07b9bf812ff8d3ea91ccd2dc2f
- name: Post URL as PR comment
uses: mshick/add-pr-comment@v1
with:
message: "🚀 Deployed Preview: http://${{steps.surge-url.outputs.result}} ✨"
repo-token: ${{ steps.token.outputs.GH_TOKEN }}