-
Notifications
You must be signed in to change notification settings - Fork 2
57 lines (50 loc) · 2.03 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
# This workflow will build a docker container, publish it to IBM Container Registry,
# and deploy it to an existing IKS cluster
name: Build and Deploy Dev
on:
workflow_dispatch:
# 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-dev:
name: Setup, Build, Publish, and Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Turnstyle ensures that this job only runs one at a time in this repository
- name: Turnstyle
uses: softprops/turnstyle@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: create pem file
env:
IOT_PEM_CERT: ${{ secrets.IOT_PEM_CERT }}
run: |
echo "$IOT_PEM_CERT" > messaging.pem
- 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: $IKS_DEPLOYMENT_NAME
container-name: $CONTAINER_NAME
github-sha: $GITHUB_SHA
icr-namespace: $ICR_NAMESPACE
image-name: $IMAGE_NAME
k8s-cluster-name: $IKS_CLUSTER
k8s-cluster-namespace: $K8S_CLUSTER_NAMESPACE
registry-hostname: $ICR_REGISTRY_HOSTNAME
working-directory: "."