Skip to content

Commit

Permalink
Update build + deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
jmandel committed Aug 2, 2024
1 parent 512b4e9 commit bf187cb
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 81 deletions.
40 changes: 17 additions & 23 deletions .github/workflows/demo-portals.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,30 @@
name: Deploy Health Wallet Demo master branch to ci
# Basics from https://docs.microsoft.com/en-us/azure/dev-spaces/how-to/github-actions
name: Deploy Server to k8s
on:
workflow_dispatch: {}
workflow_dispatch:
push:
branches:
- master
paths:
- "demo-portals/**"

permissions:
id-token: write
contents: read
packages: write
jobs:
build-demo-portals:
build:
environment: k8deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: azure/docker-login@v1
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
login-server: ${{ fromJSON(secrets.AKS_2023).containerRegistry }}
username: ${{ fromJSON(secrets.AKS_2023).clientId }}
password: ${{ fromJSON(secrets.AKS_2023).clientSecret }}
- uses: azure/login@v1
with:
creds: ${{ secrets.AKS_2023 }}
- uses: azure/aks-set-context@v3
with:
cluster-name: ${{ fromJSON(secrets.AKS_2023).clusterName }}
resource-group: ${{ fromJSON(secrets.AKS_2023).resourceGroup }}
admin: 'true'
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and rollout to CI
working-directory: demo-portals
run: |
docker build . \
-t ${{ fromJSON(secrets.AKS_2023).containerRegistry }}/demo-portals:$GITHUB_SHA \
-t ${{ fromJSON(secrets.AKS_2023).containerRegistry }}/demo-portals:latest
docker push ${{ fromJSON(secrets.AKS_2023).containerRegistry }}/demo-portals
kubectl -n siop rollout restart deployment/demo-portals
-t ghcr.io/smart-on-fhir/health-cards-tests:$GITHUB_SHA \
-t ghcr.io/smart-on-fhir/health-cards-tests:latest
docker push ghcr.io/smart-on-fhir/health-cards-tests
# kubectl -n siop rollout restart deployment/demo-portals
60 changes: 2 additions & 58 deletions k8s.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: nginx
cert-manager.io/cluster-issuer: letsencrypt-prod
name: siop-ingress
namespace: siop
Expand All @@ -19,71 +18,16 @@ spec:
http:
paths:
- pathType: Prefix
path: "/"
path: /
backend:
service:
name: demo-portals
port:
number: 80
- host: c19.cards
http:
paths:
- pathType: Prefix
path: "/"
backend:
service:
name: siop
port:
number: 80
tls:
- hosts:
- c19.cards
- demo-portals.smarthealth.cards
secretName: tls-secret
status:
loadBalancer:
ingress:
- {}
---
apiVersion: v1
kind: Service
metadata:
namespace: siop
name: siop
spec:
selector:
app: siop
ports:
- protocol: TCP
port: 80
targetPort: 8080
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: siop
namespace: siop
labels:
app: siop
spec:
replicas: 1
selector:
matchLabels:
app: siop
template:
metadata:
labels:
app: siop
spec:
volumes:
containers:
- name: ui
image: argonautcontainerregistry.azurecr.io/siop:latest
ports:
- containerPort: 8080
env:
- name: SERVER_BASE
value: "https://c19.cards/api"
---
apiVersion: v1
kind: Service
Expand Down Expand Up @@ -118,7 +62,7 @@ spec:
volumes:
containers:
- name: demo-portals
image: argonautcontainerregistry.azurecr.io/demo-portals:latest
image: ghcr.io/smart-on-fhir/health-cards-tests:latest
imagePullPolicy: Always
ports:
- containerPort: 8080
Expand Down

0 comments on commit bf187cb

Please sign in to comment.