chore(gha): bump actions/deploy-pages from 2 to 3 #587
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: Surge Preview for Pull Request | |
on: | |
pull_request: | |
# To manage 'surge-preview' action teardown, add default event types + closed event type | |
types: [opened, synchronize, reopened, closed] | |
branches: | |
- master | |
permissions: | |
pull-requests: write | |
jobs: | |
demo_preview: # the id is used by surge to generate the surge url | |
runs-on: ${{ vars.RUNNER_UBUNTU }} | |
steps: | |
- uses: bonitasoft/actions/packages/surge-preview-tools@v2 | |
id: surge-preview-tools | |
with: | |
surge-token: ${{ secrets.SURGE_TOKEN }} | |
- name: Echo surge preview tools output | |
run: | | |
echo "can-run-surge-command: ${{ steps.surge-preview-tools.outputs.can-run-surge-command }}" | |
echo "domain-exist: ${{ steps.surge-preview-tools.outputs.domain-exist }}" | |
echo "preview-url: ${{ steps.surge-preview-tools.outputs.preview-url }}" | |
echo "surge-token-valid: ${{ steps.surge-preview-tools.outputs.surge-token-valid }}" | |
- name: Build fake demo | |
if: ${{ github.event.action != 'closed' }} | |
env: | |
PR_NUMBER: ${{ github.event.pull_request.number }} | |
run: | | |
mkdir site | |
echo "This is a preview site for <b>PR #${PR_NUMBER}</b>" > site/index.html | |
- name: Publish Demo preview | |
if: steps.surge-preview-tools.outputs.can-run-surge-command == 'true' | |
id: publish_demo_preview | |
uses: afc163/surge-preview@v1 | |
with: | |
surge_token: ${{ secrets.SURGE_TOKEN }} | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
dist: site | |
failOnError: true | |
teardown: true | |
build: | | |
ls -lh site |