Ensured preview envs are generated on PRs only

This commit is contained in:
Alejandro Celaya 2021-05-09 14:03:59 +02:00
parent f74270a767
commit 2ba8db1fd3

View file

@ -2,9 +2,6 @@ name: Deploy preview
on: on:
pull_request: null pull_request: null
push:
branches:
- main
jobs: jobs:
deploy: deploy:
@ -19,7 +16,7 @@ jobs:
node-version: 14.15 node-version: 14.15
- name: Generate slug - name: Generate slug
id: generate_slug id: generate_slug
run: echo "##[set-output name=slug;]$(echo ${GITHUB_REF#refs/heads/} | sed -r 's/[~\^]+//g' | sed -r 's/[^a-zA-Z0-9]+/-/g' | sed -r 's/^-+\|-+$//g' | tr A-Z a-z)" run: echo "##[set-output name=slug;]$(echo ${GITHUB_HEAD_REF#refs/heads/} | sed -r 's/[~\^]+//g' | sed -r 's/[^a-zA-Z0-9]+/-/g' | sed -r 's/^-+\|-+$//g' | tr A-Z a-z)"
- name: Build - name: Build
run: | run: |
npm ci && \ npm ci && \