-
Notifications
You must be signed in to change notification settings - Fork 7
102 lines (93 loc) · 3.94 KB
/
deploy-dev.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
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: Build and Deploy Dev
# Execute on every push to master
on:
workflow_dispatch:
push: # Execute on every push to the master branch. Merging a pull request counts as a push.
branches:
- main
# Environment variables available to all jobs and steps in this workflow
env:
GITHUB_SHA: ${{ github.sha }}
IBM_CLOUD_API_KEY: ${{ secrets.IBM_CLOUD_API_KEY_DEV }}
IBM_CLOUD_REGION: ${{ secrets.IBM_CLOUD_REGION_DEV }}
IBM_CLOUD_RESOURCE_GROUP: ${{ secrets.IBM_CLOUD_RESOURCE_GROUP_DEV }}
ICR_REGION: ${{ secrets.ICR_REGION_DEV }}
ICR_NAMESPACE: ${{ secrets.ICR_NAMESPACE_DEV }}
ICR_REGISTRY_HOSTNAME: ${{secrets.ICR_REGISTRY_HOSTNAME_DEV}}
IKS_CLUSTER: ${{ secrets.IKS_CLUSTER_DEV }}
K8S_CLUSTER_NAMESPACE: ${{ secrets.K8S_CLUSTER_NAMESPACE_DEV }}
IKS_DEPLOYMENT_NAME: ${{ secrets.IKS_DEPLOYMENT_NAME_DEV }}
CONTAINER_NAME: ${{ secrets.CONTAINER_NAME_DEV }}
IMAGE_NAME: ${{ secrets.IMAGE_NAME_DEV }}
jobs:
setup-build-publish-deploy:
name: Setup, Build, Publish, and Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Add VCAP_LOCAL_DEV from secret to development environment
env:
VCAP_LOCAL: ${{ secrets.VCAP_LOCAL_DEV }}
run: |
echo "$VCAP_LOCAL" >> ./pyrrha-dashboard/api-auth/vcap-local.json
# A GitHub Action for serializing workflow runs
- name: Turnstyle
uses: softprops/turnstyle@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update environment args for Docker Build
env:
REACT_APP_WEBSOCKET_URL: ${{secrets.REACT_APP_WEBSOCKET_URL_DEV}}
REACT_APP_MAPBOX_ACCESS_TOKEN: ${{secrets.REACT_APP_MAPBOX_ACCESS_TOKEN_DEV}}
run: |
sed -i "s|PYRRHA_WS_URL|$REACT_APP_WEBSOCKET_URL|" ./pyrrha-dashboard/Dockerfile
sed -i "s|PYRRHA_MAPBOX_TOKEN|$REACT_APP_MAPBOX_ACCESS_TOKEN|" ./pyrrha-dashboard/Dockerfile
grep -i "REACT_APP" ./pyrrha-dashboard/Dockerfile
- name: Deploy api-main
uses: call-for-code/build-push-deploy@main
with:
cloud-api-key: $IBM_CLOUD_API_KEY
cloud-region: $IBM_CLOUD_REGION
icr-region: $ICR_REGION
cloud-resource-group: $IBM_CLOUD_RESOURCE_GROUP
deployment-name: api-main
container-name: api-main
github-sha: $GITHUB_SHA
icr-namespace: $ICR_NAMESPACE
image-name: api-main
k8s-cluster-name: $IKS_CLUSTER
k8s-cluster-namespace: $K8S_CLUSTER_NAMESPACE
registry-hostname: $ICR_REGISTRY_HOSTNAME
working-directory: "pyrrha-dashboard/api-main"
- name: Deploy api-auth
uses: call-for-code/build-push-deploy@938a160985387d0b683b4319d0daf4ec6732b763
with:
cloud-api-key: $IBM_CLOUD_API_KEY
cloud-region: $IBM_CLOUD_REGION
icr-region: $ICR_REGION
cloud-resource-group: $IBM_CLOUD_RESOURCE_GROUP
deployment-name: api-auth
container-name: api-auth
github-sha: $GITHUB_SHA
icr-namespace: $ICR_NAMESPACE
image-name: api-auth
k8s-cluster-name: $IKS_CLUSTER
k8s-cluster-namespace: $K8S_CLUSTER_NAMESPACE
registry-hostname: $ICR_REGISTRY_HOSTNAME
working-directory: "pyrrha-dashboard/api-auth"
- name: Deploy dash
uses: call-for-code/build-push-deploy@938a160985387d0b683b4319d0daf4ec6732b763
with:
cloud-api-key: $IBM_CLOUD_API_KEY
cloud-region: $IBM_CLOUD_REGION
icr-region: $ICR_REGION
cloud-resource-group: $IBM_CLOUD_RESOURCE_GROUP
deployment-name: dash
container-name: dash
github-sha: $GITHUB_SHA
icr-namespace: $ICR_NAMESPACE
image-name: dash
k8s-cluster-name: $IKS_CLUSTER
k8s-cluster-namespace: $K8S_CLUSTER_NAMESPACE
registry-hostname: $ICR_REGISTRY_HOSTNAME
working-directory: "pyrrha-dashboard"