Skip to content

Commit c87687b

Browse files
Merge pull request #39 from IFRCGo/Hotfix/WN-321
fix
2 parents 322d58b + 2851fe2 commit c87687b

2 files changed

Lines changed: 97 additions & 97 deletions

File tree

Lines changed: 49 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,54 @@
11
name: Production pipeline
22

33
on:
4-
workflow_dispatch: # Allows manual execution
5-
6-
jobs:
7-
build-and-deploy:
8-
runs-on: ubuntu-latest
9-
steps:
10-
- name: 'Checkout GitHub Action'
11-
uses: actions/checkout@main
12-
13-
- name: 'Login via Azure CLI'
14-
uses: azure/login@v1
15-
with:
16-
creds: ${{ secrets.AZURE_CREDENTIALS }}
17-
18-
- name: 'Set up Kubernetes'
19-
uses: azure/aks-set-context@v2
20-
with:
21-
creds: ${{ secrets.AZURE_CREDENTIALS }}
22-
cluster-name: ${{ secrets.AKS_CLUSTER_NAME }}
23-
resource-group: ${{ secrets.AKS_RESOURCE_GROUP }}
24-
25-
- name: 'Build and push image'
26-
uses: azure/docker-login@v1
27-
with:
28-
login-server: ${{ secrets.REGISTRY_LOGIN_SERVER }}
29-
username: ${{ secrets.REGISTRY_USERNAME }}
30-
password: ${{ secrets.REGISTRY_PASSWORD }}
31-
- run: |
32-
if [ ! -f .env ]; then
33-
touch .env
34-
fi
35-
cp swagger.prod .env
36-
docker build -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi:${{ github.sha }} -f ./docker/Dockerfile .
37-
docker tag ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi:${{ github.sha }} ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi:latest
38-
39-
docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi:${{ github.sha }}
40-
docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi:latest
41-
- name: 'Copy production values files'
42-
run: |
43-
cp ./helm-chart/values-production.yaml ./helm-chart/values.yaml
44-
45-
- name: 'Deploy to AKS with Helm'
46-
run: |
47-
helm upgrade --install whatnow ./helm-chart \
48-
--namespace ${{ secrets.AKS_CLUSTER_NAMESPACE }} \
49-
--create-namespace
4+
pull_request:
5+
types:
6+
- closed
7+
branches:
8+
- 'staging'
509

5110

11+
jobs:
12+
build-and-deploy:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: 'Checkout GitHub Action'
16+
uses: actions/checkout@main
17+
18+
- name: 'Login via Azure CLI'
19+
uses: azure/login@v1
20+
with:
21+
creds: ${{ secrets.AZURE_CREDENTIALS }}
22+
23+
- name: 'Set up Kubernetes'
24+
uses: azure/aks-set-context@v2
25+
with:
26+
creds: ${{ secrets.AZURE_CREDENTIALS }}
27+
cluster-name: ${{ secrets.AKS_CLUSTER_NAME }}
28+
resource-group: ${{ secrets.AKS_RESOURCE_GROUP }}
29+
30+
- name: 'Build and push image'
31+
uses: azure/docker-login@v1
32+
with:
33+
login-server: ${{ secrets.REGISTRY_LOGIN_SERVER }}
34+
username: ${{ secrets.REGISTRY_USERNAME }}
35+
password: ${{ secrets.REGISTRY_PASSWORD }}
36+
- run: |
37+
if [ ! -f .env ]; then
38+
touch .env
39+
fi
40+
cp swagger.prod .env
41+
docker build -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi-qa:${{ github.sha }} -f ./docker/Dockerfile .
42+
docker tag ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi-qa:${{ github.sha }} ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi-qa:latest
43+
docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi-qa:${{ github.sha }}
44+
docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi-qa:latest
45+
46+
- name: 'Copy staging values file'
47+
run: |
48+
cp ./helm-chart/values-production.yaml ./helm-chart/values.yaml
49+
50+
- name: 'Deploy to AKS with Helm'
51+
run: |
52+
helm upgrade --install whatnow-qa ./helm-chart \
53+
--namespace ${{ secrets.AKS_CLUSTER_NAMESPACE_QA }} \
54+
--create-namespace

.github/workflows/qa-pipeline.yml

Lines changed: 48 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,54 @@
11
name: Stage pipeline
22

33
on:
4-
pull_request:
5-
types:
6-
- closed
7-
branches:
8-
- 'staging'
4+
pull_request:
5+
types:
6+
- closed
7+
branches:
8+
- 'staging'
99

1010

1111
jobs:
12-
build-and-deploy:
13-
runs-on: ubuntu-latest
14-
steps:
15-
- name: 'Checkout GitHub Action'
16-
uses: actions/checkout@main
17-
18-
- name: 'Login via Azure CLI'
19-
uses: azure/login@v1
20-
with:
21-
creds: ${{ secrets.AZURE_CREDENTIALS }}
22-
23-
- name: 'Set up Kubernetes'
24-
uses: azure/aks-set-context@v2
25-
with:
26-
creds: ${{ secrets.AZURE_CREDENTIALS }}
27-
cluster-name: ${{ secrets.AKS_CLUSTER_NAME }}
28-
resource-group: ${{ secrets.AKS_RESOURCE_GROUP }}
29-
30-
- name: 'Build and push image'
31-
uses: azure/docker-login@v1
32-
with:
33-
login-server: ${{ secrets.REGISTRY_LOGIN_SERVER }}
34-
username: ${{ secrets.REGISTRY_USERNAME }}
35-
password: ${{ secrets.REGISTRY_PASSWORD }}
36-
- run: |
37-
if [ ! -f .env ]; then
38-
touch .env
39-
fi
40-
cp swagger.qa .env
41-
docker build -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi-qa:${{ github.sha }} -f ./docker/Dockerfile .
42-
docker tag ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi-qa:${{ github.sha }} ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi-qa:latest
43-
44-
docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi-qa:${{ github.sha }}
45-
docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi-qa:latest
46-
47-
- name: 'Copy staging values file'
48-
run: |
49-
cp ./helm-chart/values-staging.yaml ./helm-chart/values.yaml
50-
51-
- name: 'Deploy to AKS with Helm'
52-
run: |
53-
helm upgrade --install whatnow-qa ./helm-chart \
54-
--namespace ${{ secrets.AKS_CLUSTER_NAMESPACE_QA }} \
55-
--create-namespace
56-
57-
12+
build-and-deploy:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: 'Checkout GitHub Action'
16+
uses: actions/checkout@main
17+
18+
- name: 'Login via Azure CLI'
19+
uses: azure/login@v1
20+
with:
21+
creds: ${{ secrets.AZURE_CREDENTIALS }}
22+
23+
- name: 'Set up Kubernetes'
24+
uses: azure/aks-set-context@v2
25+
with:
26+
creds: ${{ secrets.AZURE_CREDENTIALS }}
27+
cluster-name: ${{ secrets.AKS_CLUSTER_NAME }}
28+
resource-group: ${{ secrets.AKS_RESOURCE_GROUP }}
29+
30+
- name: 'Build and push image'
31+
uses: azure/docker-login@v1
32+
with:
33+
login-server: ${{ secrets.REGISTRY_LOGIN_SERVER }}
34+
username: ${{ secrets.REGISTRY_USERNAME }}
35+
password: ${{ secrets.REGISTRY_PASSWORD }}
36+
- run: |
37+
if [ ! -f .env ]; then
38+
touch .env
39+
fi
40+
cp swagger.qa .env
41+
docker build -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi-qa:${{ github.sha }} -f ./docker/Dockerfile .
42+
docker tag ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi-qa:${{ github.sha }} ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi-qa:latest
43+
docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi-qa:${{ github.sha }}
44+
docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi-qa:latest
45+
46+
- name: 'Copy staging values file'
47+
run: |
48+
cp ./helm-chart/values-staging.yaml ./helm-chart/values.yaml
49+
50+
- name: 'Deploy to AKS with Helm'
51+
run: |
52+
helm upgrade --install whatnow-qa ./helm-chart \
53+
--namespace ${{ secrets.AKS_CLUSTER_NAMESPACE_QA }} \
54+
--create-namespace

0 commit comments

Comments
 (0)