element-web/.github/workflows/netflify.yaml
David Baker bcc7c9cd20 Use a GitHub action to build the Netlify preview build
So we don't need netflify to sit there building the develop branch
for no reason. Also it will comment with the URL rather than having
to dig it out of the checks.

Upload part not tested yet.
2021-08-06 23:54:19 +01:00

32 lines
1.1 KiB
YAML

name: Upload Preview Build to Netlify
on:
workflow_run:
workflows: ["Layered Preview Build"]
types:
- completed
jobs:
build:
runs-on: ubuntu-latest
if: >
${{ github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Download Artifact
uses: actions/download-artifact@v2
with:
name: "Preview Build"
- name: Deploy to Netlify
uses: nwtgck/actions-netlify@v1.2
with:
publish-dir: .
github-token: ${{ secrets.GITHUB_TOKEN }}
alias: deploy-preview-${{ github.event.number }}
deploy-message: "Deploy from GitHub Actions"
enable-pull-request-comment: true
enable-commit-comment: false
overwrites-pull-request-comment: true
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
timeout-minutes: 1