-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (92 loc) · 2.87 KB
/
deployment-pipeline.yaml
File metadata and controls
97 lines (92 loc) · 2.87 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Deployment pipeline
run-name: Deployment
on:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
"pre-production":
runs-on: ubuntu-latest
environment: "pre-production"
steps:
- id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H-%M-%S')"
- run: echo "Deploying to ${{ vars.ENV }}..."
- run: echo "Done."
- name: Tag commit
uses: actions/github-script@v5
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "refs/tags/${{ steps.date.outputs.date }}-deployed-pre-production",
sha: context.sha
})
- run: echo "Running tests..."
- run: echo "Done."
"production-eu":
needs: "pre-production"
runs-on: ubuntu-latest
environment: "production-eu"
steps:
- id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H-%M-%S')"
- run: echo "Deploying to ${{ vars.ENV }}..."
- run: echo "Done."
- name: Tag commit
uses: actions/github-script@v5
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "refs/tags/${{ steps.date.outputs.date }}-deployed-production-eu",
sha: context.sha
})
"production-gate-a":
needs: "production-eu"
environment: "production-gate-a"
runs-on: ubuntu-latest
steps:
- run: echo "Enabling next wave of production deployments..."
"production-us":
needs: "production-gate-a"
runs-on: ubuntu-latest
environment: "production-us"
steps:
- id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H-%M-%S')"
- run: echo "Deploying to ${{ vars.ENV }}..."
- run: echo "Done."
- name: Tag commit
uses: actions/github-script@v5
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "refs/tags/${{ steps.date.outputs.date }}-deployed-production-us",
sha: context.sha
})
"production-jp":
needs: "production-gate-a"
runs-on: ubuntu-latest
environment: "production-jp"
steps:
- id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H-%M-%S')"
- run: echo "Deploying to ${{ vars.ENV }}..."
- run: echo "Done."
- name: Tag commit
uses: actions/github-script@v5
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "refs/tags/${{ steps.date.outputs.date }}-deployed-production-jp",
sha: context.sha
})