Skip to content

Commit 4bef130

Browse files
authored
Merge pull request #809 from CodinGame/deploy-demo-on-PR
Deploy demo on pr
2 parents 62b35f9 + abfa40e commit 4bef130

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

.github/workflows/check_build.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ jobs:
2020
check:
2121
name: Check build
2222
runs-on: ubuntu-latest
23+
env:
24+
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
25+
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
2326

2427
steps:
2528
- name: Checkout
@@ -46,4 +49,18 @@ jobs:
4649
run: npm ci
4750
- name: Build demo
4851
working-directory: ./demo
49-
run: npm run build
52+
run: npm run build:netlify
53+
- name: Deploy demo preview to Netlify
54+
if: github.event.pull_request.head.repo.full_name == github.repository && env.NETLIFY_AUTH_TOKEN != '' && env.NETLIFY_SITE_ID != ''
55+
uses: nwtgck/actions-netlify@v3.0
56+
with:
57+
publish-dir: './demo/dist'
58+
production-branch: ${{ github.event.repository.default_branch }}
59+
production-deploy: false
60+
alias: deploy-preview-${{ github.event.pull_request.number }}
61+
github-token: ${{ secrets.GITHUB_TOKEN }}
62+
deploy-message: PR #${{ github.event.pull_request.number }} - ${{ github.event.pull_request.title }}
63+
enable-pull-request-comment: true
64+
overwrites-pull-request-comment: true
65+
netlify-config-path: ./demo/netlify.toml
66+
timeout-minutes: 1

0 commit comments

Comments
 (0)