-
-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (33 loc) · 1.2 KB
/
deploy-staging.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
name: deploy - staging
on:
workflow_dispatch:
release:
types:
- prereleased
jobs:
build:
uses: ./.github/workflows/build-images.yml
secrets: inherit
deploy:
runs-on: ubuntu-latest
environment: staging
needs: build
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install doctl
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DO_REGISTRY_KEY }}
- name: Save DigitalOcean kubeconfig
run: doctl kubernetes cluster kubeconfig save ${{ vars.CLUSTER_NAME }}
- name: Update kustomization
run: |
cd k8s/overlays/staging
kustomize edit set image api=${{ secrets.DO_REGISTRY }}/${{ vars.API_IMAGE }}:${{ needs.build.outputs.image_tag }}
kustomize edit set image queue=${{ secrets.DO_REGISTRY }}/${{ vars.QUEUE_IMAGE }}:${{ needs.build.outputs.image_tag }}
kustomize edit set image ui=${{ secrets.DO_REGISTRY }}/${{ vars.UI_IMAGE }}:${{ needs.build.outputs.image_tag }}
- name: Deploy to staging
run: |
kubectl apply -k k8s/overlays/staging
kubectl rollout status deployment/farmhand-api-staging -n staging --timeout=2m