-
Notifications
You must be signed in to change notification settings - Fork 3
63 lines (54 loc) · 1.46 KB
/
rw-entry-preview-docker-nomad.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
62
63
name: Preview (Docker + Nomad)
# A generic reusing workflow that releases a preview of a project that:
# - use Docker.
# - use Nomad.
on:
workflow_call:
inputs:
service:
description: Name of the service on Nomad
required: true
type: string
source-root:
description: Root location of the project (where Dockerfile is)
default: .
type: string
url:
description: URL of the service
required: true
type: string
secrets:
NOMAD_SERVICE_PREVIEW_KEY:
description: Secret key to deploy the preview service
required: true
concurrency:
group: preview
cancel-in-progress: true
jobs:
preview_labels_pre:
name: Update preview labels
uses: ./.github/workflows/rw-preview-label.yml
release:
name: Release
uses: ./.github/workflows/rw-docker-build.yml
with:
source-root: ${{ inputs.source-root }}
publish: true
ref: ${{ github.event.pull_request.head.sha }}
deploy:
needs:
- release
name: Deploy
uses: ./.github/workflows/rw-nomad-deploy.yml
secrets:
NOMAD_SERVICE_KEY: ${{ secrets.NOMAD_SERVICE_PREVIEW_KEY }}
with:
environment: Preview
service: ${{ inputs.service}}
url: ${{ inputs.url }}
version: "@sha256:${{ needs.release.outputs.digest }}"
preview_labels_post:
needs:
- deploy
name: Update preview labels
uses: ./.github/workflows/rw-preview-label.yml