-
Notifications
You must be signed in to change notification settings - Fork 41
54 lines (43 loc) · 1.39 KB
/
dalchini_pr_deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Netlify PR Preview Deploy
on:
pull_request_target:
types: [labeled]
env:
REACT_APP_ZIMBRA_URL: ${{secrets.REACT_APP_ZIMBRA_URL}}
jobs:
netlify-pr-preview:
name: Netlify PR Preview Deploy
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: dalchini
if: contains(github.event.pull_request.labels.*.name, 'safe-to-build-dalchini')
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
ref: ${{github.event.pull_request.head.sha}}
- name: Setup Node v16
uses: actions/setup-node@v2
with:
node-version: '16.x'
- name: Create .env File
run: |
touch .env
echo REACT_APP_ZIMBRA_URL=$REACT_APP_ZIMBRA_URL >> .env
- name: Install Dependencies
run: yarn install
- name: Build React WebApp
run: yarn build
- name: Deploy to Netlify
uses: nwtgck/actions-netlify@v1.1
with:
publish-dir: 'dalchini/build'
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: 'Deploy preview for ${{github.event.pull_request.title}} is ready ✅'
enable-pull-request-comment: true
enable-commit-comment: false
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}