-
Notifications
You must be signed in to change notification settings - Fork 271
34 lines (32 loc) · 1.09 KB
/
deployment.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
name: Hosted PR and Dev/Prod Deployment
on:
pull_request:
types: [opened, reopened, synchronize]
push:
branches:
- dev
- main
workflow_dispatch:
inputs:
environment:
required: false
type: choice
description: "Select the environment to deploy to (only required for production deployment)"
options:
- staging
- prod
jobs:
deploy:
if: |
(github.event_name == 'pull_request' && startsWith(github.head_ref, 'hosted/')) ||
(github.event_name == 'push' && github.ref == 'refs/heads/dev') ||
(github.event_name == 'push' && github.ref == 'refs/heads/main') ||
(github.event_name == 'workflow_dispatch' && inputs.environment == 'prod')
uses: ./.github/workflows/build_and_deploy.yml
with:
environment: ${{ inputs.environment ||
(github.ref == 'refs/heads/dev' && 'dev') ||
(github.ref == 'refs/heads/main' && 'staging') ||
(github.event_name == 'pull_request' && 'dev') ||
'dev' }}
secrets: inherit