-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (48 loc) · 1.34 KB
/
deploy.yml
File metadata and controls
53 lines (48 loc) · 1.34 KB
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
name: Deploy
concurrency: deploy
on:
release:
types: [published]
push:
branches:
- main
workflow_dispatch:
inputs:
environment:
description: |
Environment to deploy.
Must select the default branch for staging, and a release tag for production.
type: environment
required: true
jobs:
build:
runs-on: ubuntu-latest
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
steps:
- run: env
- run: echo "$GITHUB_CONTEXT"
staging:
if: |
github.event_name == 'push' || (
github.event_name == 'workflow_dispatch' &&
github.event.inputs.environment == 'staging' &&
github.ref_name == github.event.repository.default_branch
)
runs-on: ubuntu-latest
environment: staging
needs: build
steps:
- run: echo "TODO deploy staging iff we're a push or a manual trigger on ${{ github.event.repository.default_branch }}"
production:
if: |
github.event_name == 'release' || (
github.event_name == 'workflow_dispatch' &&
github.event.inputs.environment == 'production' &&
github.ref_type == 'tag'
)
runs-on: ubuntu-latest
environment: production
needs: build
steps:
- run: echo "TODO deploy production iff we're a release or a manual trigger on a tag"