Files
openlayers/.github/workflows/deploy-preview.yml
2021-10-22 22:08:07 -10:00

49 lines
1.5 KiB
YAML

name: Deploy Preview
on:
pull_request_target:
branches:
- main
jobs:
deploy-preview:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v1
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- run: npm install --global netlify-cli
- uses: lewagon/wait-on-check-action@v1.1.1
with:
ref: ${{github.event.pull_request.head.sha}}
check-name: 'build-preview'
repo-token: ${{secrets.GITHUB_TOKEN}}
wait-interval: 10
- uses: dawidd6/action-download-artifact@v2
with:
github_token: ${{secrets.GITHUB_TOKEN}}
workflow: build-preview.yml
pr: ${{github.event.number}}
name: site
path: build/site
- env:
NETLIFY_AUTH_TOKEN: ${{secrets.NETLIFY_AUTH_TOKEN}}
NETLIFY_SITE_ID: ${{secrets.NETLIFY_SITE_ID}}
run: netlify deploy --dir=build/site --alias=deploy-preview-${{github.event.number}}
- uses: octokit/request-action@v2.x
with:
route: POST /repos/{owner}/{repo}/check-runs
owner: openlayers
repo: openlayers
name: preview-url
head_sha: ${{github.event.pull_request.head.sha}}
details_url: https://deploy-preview-${{github.event.number}}--ol-site.netlify.app
conclusion: "success"
status: "completed"
output: |
title: Preview URL
summary: URL of the preview deploy
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}