-
Notifications
You must be signed in to change notification settings - Fork 0
126 lines (126 loc) · 4.59 KB
/
old-build-prod.yaml
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
name: "PROD: Build and deploy til ebms til PROD"
on:
workflow_dispatch:
branches:
- main
env:
"IMAGE_EBMS": "ghcr.io/${{ github.repository }}/ebms-provider:${{ github.sha }}"
"IMAGE_CPA": "ghcr.io/${{ github.repository }}/cpa-repo:${{ github.sha }}"
"IMAGE_PAYLOAD": "ghcr.io/${{ github.repository }}/ebms-payload:${{ github.sha }}"
"IMAGE_LISTENERS": "ghcr.io/${{ github.repository }}/smtp-listeners:${{ github.sha }}"
"IMAGE_SEND_IN": "ghcr.io/${{ github.repository }}/ebms-send-in:${{ github.sha }}"
jobs:
build:
name: "build"
runs-on: "ubuntu-20.04"
permissions:
packages: write
repository-projects: write
contents: write
steps:
- uses: "actions/checkout@v4"
- uses: "actions/setup-java@v3"
with:
"java-version": "21"
"distribution": "temurin"
- name: Cache gradle wrapper
uses: actions/cache@v3
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-cache-${{ hashFiles('build.gradle') }}
restore-keys: |
${{ runner.os }}-gradle-cache-
- name: "Build and tests"
run: ./gradlew test build
env:
ORG_GRADLE_PROJECT_githubUser: x-access-token
ORG_GRADLE_PROJECT_githubPassword: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Login to GitHub Packages Docker Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: "Build and push ebms-provider Docker image"
run: "docker build ebms-provider --pull --tag ${IMAGE_EBMS} -f Dockerfile && docker push ${IMAGE_EBMS}"
- name: "Build and push cpa-repo Docker image"
run: "docker build cpa-repo --pull --tag ${IMAGE_CPA} -f Dockerfile && docker push ${IMAGE_CPA}"
- name: "Build and push ebms-payload Docker image"
run: "docker build ebms-payload --pull --tag ${IMAGE_PAYLOAD} -f Dockerfile && docker push ${IMAGE_PAYLOAD}"
- name: "Build and push smtp-listeners Docker image"
run: "docker build smtp-listeners --pull --tag ${IMAGE_LISTENERS} -f Dockerfile && docker push ${IMAGE_LISTENERS}"
- name: "Build and push ebms-send-in Docker image"
run: "docker build ebms-send-in --pull --tag ${IMAGE_SEND_IN} -f Dockerfile && docker push ${IMAGE_SEND_IN}"
deploy-processor:
name: "Deploy ebms provider to PROD"
needs: "build"
runs-on: "ubuntu-20.04"
steps:
- uses: "actions/checkout@v4"
- name: "Deploy to PROD"
uses: "nais/deploy/actions/deploy@v1"
env:
APIKEY: "${{ secrets.NAIS_DEPLOY_APIKEY }}"
CLUSTER: "prod-fss"
RESOURCE: ".nais/ebms-provider-prod.yaml"
IMAGE: ${{env.IMAGE_EBMS}}
deploy-cpa-repo:
name: "Deploy cpa-repo to prod"
needs: "build"
runs-on: "ubuntu-20.04"
steps:
- uses: "actions/checkout@v4"
- name: "Deploy to PROD"
uses: "nais/deploy/actions/deploy@v1"
env:
APIKEY: "${{ secrets.NAIS_DEPLOY_APIKEY }}"
CLUSTER: "prod-fss"
RESOURCE: ".nais/cpa-repo-prod.yaml"
IMAGE: ${{env.IMAGE_CPA}}
deploy-ebms-payload:
name: "Deploy ebms-payload to prod"
needs: "build"
runs-on: "ubuntu-20.04"
steps:
- uses: "actions/checkout@v4"
- name: "Deploy to PROD"
uses: "nais/deploy/actions/deploy@v1"
env:
APIKEY: "${{ secrets.NAIS_DEPLOY_APIKEY }}"
CLUSTER: "prod-fss"
RESOURCE: ".nais/ebms-payload-prod.yaml"
IMAGE: ${{env.IMAGE_PAYLOAD}}
deploy-smtp-listeners:
name: "Deploy smtp-listeners to prod"
needs: "build"
runs-on: "ubuntu-20.04"
steps:
- uses: "actions/checkout@v4"
- name: "Deploy to PROD"
uses: "nais/deploy/actions/deploy@v1"
env:
APIKEY: "${{ secrets.NAIS_DEPLOY_APIKEY }}"
CLUSTER: "prod-fss"
RESOURCE: ".nais/smtp-listeners-prod.yaml"
IMAGE: ${{env.IMAGE_LISTENERS}}
deploy-ebms-send-in:
name: "Deploy ebms-send-in to prod"
needs: "build"
runs-on: "ubuntu-20.04"
permissions:
contents: read
id-token: write
steps:
- uses: "actions/checkout@v4"
- name: "Deploy to PROD"
uses: "nais/deploy/actions/deploy@v2"
env:
CLUSTER: "prod-fss"
RESOURCE: ".nais/ebms-send-in-prod.yaml"
IMAGE: ${{env.IMAGE_SEND_IN}}