-
Notifications
You must be signed in to change notification settings - Fork 8
61 lines (54 loc) · 1.58 KB
/
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
55
56
57
58
59
60
61
name: Deploy
on:
push:
pull_request:
types: [closed]
#concurrency:
# group: '${{ github.ref }}'
# cancel-in-progress: true
jobs:
build:
name: build
uses: './.github/workflows/build.yml'
if: github.event_name != 'pull_request'
deploy_review:
needs:
- build
runs-on: [self-hosted, deployment-runner]
container:
image: git.dbyte.xyz/distro/levant
if: github.ref != 'refs/heads/main' && github.event_name == 'push'
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- run: |
levant deploy \
-var git_sha="${GITHUB_SHA}" \
-var environment_slug="${GITHUB_REF_NAME}" \
-address "http://nomad.service.consul:4646" \
./.github/deploy/review.hcl
stop_review:
runs-on: [self-hosted, deployment-runner]
container:
image: multani/nomad
if: github.event_name == 'pull_request'
timeout-minutes: 60
steps:
- run: echo "null"
- run: nomad status -address=http://nomad.service.consul:4646
- run: nomad job stop -address=http://nomad.service.consul:4646 -purge blockbot-${GITHUB_HEAD_REF}
deploy_prod:
needs:
- build
runs-on: [self-hosted, deployment-runner]
container:
image: git.dbyte.xyz/distro/levant
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- run: |
levant deploy \
-var git_sha="${GITHUB_SHA}" \
-address "http://nomad.service.consul:4646" \
./.github/deploy/production.hcl