-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
60 lines (56 loc) · 1.56 KB
/
action.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
name: "build & deploy docker in NX Workspace"
description: "builds docker image and deploys it in k8s cluster"
inputs:
ACR_URL:
description: "tbd..."
required: true
AZURE_LOGIN:
description: "tbd..."
required: true
AZURE_PASSWORD:
description: "tbd..."
required: true
AZURE_CREDENTIALS:
description: "tbd..."
required: true
AZURE_RESOURCEGROUP:
description: "tbd..."
required: true
AZURE_CLUSTERNAME:
description: "tbd..."
required: true
runs:
using: "composite"
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: nrwl/nx-set-shas@v2
- uses: azure/docker-login@v1
with:
login-server: ${{ inputs.ACR_URL }}
username: ${{ inputs.AZURE_LOGIN }}
password: ${{ inputs.AZURE_PASSWORD }}
- uses: azure/login@v1
with:
creds: ${{ inputs.AZURE_CREDENTIALS }}
- uses: azure/aks-set-context@v2
with:
resource-group: ${{ inputs.AZURE_RESOURCEGROUP }}
cluster-name: ${{ inputs.AZURE_CLUSTERNAME }}
- name: build docker base image
shell: bash
run: |
mkdir -p ./repo/docker-cache
XFILE=./repo/docker-cache/base.tar
if [ -f "$XFILE" ]; then
echo "$XFILE exists."
docker load < ./repo/docker-cache/base.tar
else
echo "$XFILE does not exist."
docker build --tag=builder .
docker save -o ./repo/docker-cache/base.tar builder
fi
chmod +x ./tools/docker/*.sh
mkdir -p k8s
- uses: actions/download-artifact@v3