Windup 6.3.0.Final Version #74
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: 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 }} |