Skip to content
Merged

fix #39

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 49 additions & 46 deletions .github/workflows/production-pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,54 @@
name: Production pipeline

on:
workflow_dispatch: # Allows manual execution

jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@main

- name: 'Login via Azure CLI'
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}

- name: 'Set up Kubernetes'
uses: azure/aks-set-context@v2
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
cluster-name: ${{ secrets.AKS_CLUSTER_NAME }}
resource-group: ${{ secrets.AKS_RESOURCE_GROUP }}

- name: 'Build and push image'
uses: azure/docker-login@v1
with:
login-server: ${{ secrets.REGISTRY_LOGIN_SERVER }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- run: |
if [ ! -f .env ]; then
touch .env
fi
cp swagger.prod .env
docker build -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi:${{ github.sha }} -f ./docker/Dockerfile .
docker tag ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi:${{ github.sha }} ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi:latest

docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi:${{ github.sha }}
docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi:latest
- name: 'Copy production values files'
run: |
cp ./helm-chart/values-production.yaml ./helm-chart/values.yaml

- name: 'Deploy to AKS with Helm'
run: |
helm upgrade --install whatnow ./helm-chart \
--namespace ${{ secrets.AKS_CLUSTER_NAMESPACE }} \
--create-namespace
pull_request:
types:
- closed
branches:
- 'staging'


jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@main

- name: 'Login via Azure CLI'
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}

- name: 'Set up Kubernetes'
uses: azure/aks-set-context@v2
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
cluster-name: ${{ secrets.AKS_CLUSTER_NAME }}
resource-group: ${{ secrets.AKS_RESOURCE_GROUP }}

- name: 'Build and push image'
uses: azure/docker-login@v1
with:
login-server: ${{ secrets.REGISTRY_LOGIN_SERVER }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- run: |
if [ ! -f .env ]; then
touch .env
fi
cp swagger.prod .env
docker build -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi-qa:${{ github.sha }} -f ./docker/Dockerfile .
docker tag ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi-qa:${{ github.sha }} ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi-qa:latest
docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi-qa:${{ github.sha }}
docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi-qa:latest

- name: 'Copy staging values file'
run: |
cp ./helm-chart/values-production.yaml ./helm-chart/values.yaml

- name: 'Deploy to AKS with Helm'
run: |
helm upgrade --install whatnow-qa ./helm-chart \
--namespace ${{ secrets.AKS_CLUSTER_NAMESPACE_QA }} \
--create-namespace
99 changes: 48 additions & 51 deletions .github/workflows/qa-pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,57 +1,54 @@
name: Stage pipeline

on:
pull_request:
types:
- closed
branches:
- 'staging'
pull_request:
types:
- closed
branches:
- 'staging'


jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@main

- name: 'Login via Azure CLI'
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}

- name: 'Set up Kubernetes'
uses: azure/aks-set-context@v2
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
cluster-name: ${{ secrets.AKS_CLUSTER_NAME }}
resource-group: ${{ secrets.AKS_RESOURCE_GROUP }}

- name: 'Build and push image'
uses: azure/docker-login@v1
with:
login-server: ${{ secrets.REGISTRY_LOGIN_SERVER }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- run: |
if [ ! -f .env ]; then
touch .env
fi
cp swagger.qa .env
docker build -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi-qa:${{ github.sha }} -f ./docker/Dockerfile .
docker tag ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi-qa:${{ github.sha }} ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi-qa:latest

docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi-qa:${{ github.sha }}
docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi-qa:latest

- name: 'Copy staging values file'
run: |
cp ./helm-chart/values-staging.yaml ./helm-chart/values.yaml

- name: 'Deploy to AKS with Helm'
run: |
helm upgrade --install whatnow-qa ./helm-chart \
--namespace ${{ secrets.AKS_CLUSTER_NAMESPACE_QA }} \
--create-namespace


build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@main

- name: 'Login via Azure CLI'
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}

- name: 'Set up Kubernetes'
uses: azure/aks-set-context@v2
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
cluster-name: ${{ secrets.AKS_CLUSTER_NAME }}
resource-group: ${{ secrets.AKS_RESOURCE_GROUP }}

- name: 'Build and push image'
uses: azure/docker-login@v1
with:
login-server: ${{ secrets.REGISTRY_LOGIN_SERVER }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- run: |
if [ ! -f .env ]; then
touch .env
fi
cp swagger.qa .env
docker build -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi-qa:${{ github.sha }} -f ./docker/Dockerfile .
docker tag ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi-qa:${{ github.sha }} ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi-qa:latest
docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi-qa:${{ github.sha }}
docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi-qa:latest

- name: 'Copy staging values file'
run: |
cp ./helm-chart/values-staging.yaml ./helm-chart/values.yaml

- name: 'Deploy to AKS with Helm'
run: |
helm upgrade --install whatnow-qa ./helm-chart \
--namespace ${{ secrets.AKS_CLUSTER_NAMESPACE_QA }} \
--create-namespace
Loading