-
Notifications
You must be signed in to change notification settings - Fork 7
102 lines (92 loc) · 3.47 KB
/
cdk_package_code.yml
File metadata and controls
102 lines (92 loc) · 3.47 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
98
99
100
101
102
name: cdk package code
on:
workflow_call:
inputs:
VERSION_NUMBER:
required: true
type: string
COMMIT_ID:
required: true
type: string
pinned_image:
type: string
required: true
jobs:
package_code:
runs-on: ubuntu-22.04
container:
image: ${{ inputs.pinned_image }}
options: --user 1001:1001 --group-add 128
defaults:
run:
shell: bash
permissions:
id-token: write
contents: read
packages: read
steps:
- name: copy .tool-versions
run: |
cp /home/vscode/.tool-versions "$HOME/.tool-versions"
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
persist-credentials: false
- name: make install
run: |
make install build-proxygen-specification
- name: Build FHIR Facade Docker image
id: build-fhir-facade-image
run: |
docker build -t "fhir-facade-repo:${VERSION_NUMBER}" -f packages/coordinator/Dockerfile .
docker save "fhir-facade-repo:${VERSION_NUMBER}" -o FHIR_facade_docker.img
env:
VERSION_NUMBER: ${{ inputs.VERSION_NUMBER }}
- name: get latest validator release
id: get_latest_validator_release
run: |
LATEST_VALIDATOR_VERSION=v1.0.348-alpha
echo "LATEST_VALIDATOR_VERSION=${LATEST_VALIDATOR_VERSION}" >> "$GITHUB_OUTPUT"
- name: Download Dockerfile, manifest.json and JAR file for Validator
run: |
curl -L -o Dockerfile "https://github.com/NHSDigital/validation-service-fhir-r4/releases/download/${LATEST_VALIDATOR_VERSION}/Dockerfile"
curl -L -o manifest.json "https://github.com/NHSDigital/validation-service-fhir-r4/releases/download/${LATEST_VALIDATOR_VERSION}/manifest.json"
curl -L -o fhir-validator.jar "https://github.com/NHSDigital/validation-service-fhir-r4/releases/download/${LATEST_VALIDATOR_VERSION}/fhir-validator.jar"
env:
LATEST_VALIDATOR_VERSION: ${{ steps.get_latest_validator_release.outputs.LATEST_VALIDATOR_VERSION }}
- name: Build Validator Docker image
id: build-validator-image
run: |
docker build -t "validator-repo:${VERSION_NUMBER}" -f Dockerfile .
docker images
docker save "validator-repo:${VERSION_NUMBER}" -o validator_docker.img
env:
VERSION_NUMBER: ${{ inputs.VERSION_NUMBER }}
- name: Build python lambda dependencies
run: |
poetry export --only create_prescription -o requirements_create_prescription
mkdir -p .dependencies/create_prescription/python
pip3 install -r requirements_create_prescription -t .dependencies/create_prescription/python
- name: "package cdk"
run: |
tar -rf artifact.tar \
packages/cdk \
packages/specification \
node_modules \
package.json \
package-lock.json \
Makefile \
cdk.json \
.dependencies
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
name: upload build artifact
with:
name: cdk_artifact
path: artifact.tar
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
name: Upload docker images
with:
name: docker_artifact
path: |
FHIR_facade_docker.img
validator_docker.img