Skip to content

Commit edf5c34

Browse files
fix(ci): update helm steps
1 parent 13f485f commit edf5c34

File tree

2 files changed

+23
-11
lines changed

2 files changed

+23
-11
lines changed

.github/workflows/k8s-deploy.yml

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,15 @@ jobs:
9292
fetch: false
9393
holobranch: fixtures
9494

95+
- id: helm-projection
96+
name: 'Project holobranch: helm-chart'
97+
uses: JarvusInnovations/hologit@actions/projector/v1
98+
with:
99+
# use HEAD checked out above by checkout action
100+
ref: HEAD
101+
fetch: false
102+
holobranch: helm-chart
103+
95104
- name: Build & push Docker image
96105
uses: whoan/docker-build-with-cache-action@v5
97106
with:
@@ -116,8 +125,6 @@ jobs:
116125
117126
- name: Deploy instance via Helm template
118127
run: |
119-
set -e
120-
121128
docker_image="${DOCKER_REGISTRY}/${DOCKER_REPOSITORY}/${DOCKER_PACKAGE}:${RELEASE_NAME}"
122129
release_hostname="${RELEASE_NAME}.${KUBE_HOSTNAME}"
123130
@@ -130,14 +137,21 @@ jobs:
130137
| sort \
131138
| tee ./.pods-before
132139
133-
echo "Using helm upgrade to apply ./helm-chart to release ${RELEASE_NAME}"
134-
helm upgrade "${RELEASE_NAME}" ./helm-chart \
140+
echo "Extracting projected helm-chart to temporary directory"
141+
temp_dir=$(mktemp -d)
142+
git archive --format=tar "${{ steps.site-projection.outputs.tree }}" | ( cd "${temp_dir}" && tar -xf - )
143+
144+
echo "Using helm upgrade to apply helm-chart to release ${RELEASE_NAME}"
145+
helm upgrade "${RELEASE_NAME}" "${temp_dir}" \
135146
--install \
136-
--set name="${RELEASE_NAME}" \
137-
--set namespace="${KUBE_NAMESPACE}" \
138-
--set image="${docker_image}" \
139-
--set hostname="${release_hostname}" \
140-
--set hab.runtime.error.display=true
147+
--namespace "${KUBE_NAMESPACE}" \
148+
--set site.name="${RELEASE_NAME}" \
149+
--set site.title="laddr/${RELEASE_NAME}" \
150+
--set site.image.repository="${DOCKER_REGISTRY}/${DOCKER_REPOSITORY}/${DOCKER_PACKAGE}" \
151+
--set site.image.tag="${RELEASE_NAME}" \
152+
--set ingress.enabled=true \
153+
--set site.canonicalHostname="${release_hostname}" \
154+
--set site.displayErrors=true
141155
142156
echo "Listing pods existing after deploy"
143157
kubectl get pods \

.github/workflows/k8s-destroy.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,11 @@ jobs:
2121

2222
- name: Configure kubectl
2323
run: |
24-
set -e
2524
test -e ~/.kube || mkdir ~/.kube
2625
printf '%s' "$KUBE_CONFIG_DATA" | base64 -d > ~/.kube/config
2726
2827
- name: Delete PR Deployment
2928
run: |
30-
set -e
3129
kubectl config set-context --current --namespace="${KUBE_NAMESPACE}"
3230
kubectl delete deployment,replicaset,ingress,all -l "app.kubernetes.io/instance=${RELEASE_NAME}"
3331
kubectl delete secret "${RELEASE_NAME}-tls"

0 commit comments

Comments
 (0)