-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (36 loc) · 1.21 KB
/
deploy.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
41
42
43
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: deploy
on:
workflow_call:
inputs:
namespace:
type: string
required: true
description: "namespace to deploy to"
jobs:
build:
uses: ./.github/workflows/build.yml
secrets: inherit
with:
push: true
deploy:
runs-on: ubuntu-latest
environment: ${{ inputs.namespace }}
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/${{ inputs.namespace }}
kustomize edit set image ui=${{ secrets.DO_REGISTRY }}/${{ vars.UI_IMAGE }}:${{ needs.build.outputs.image_tag }}
- name: Deploy to ${{ inputs.namespace }}
run: |
kubectl apply -k k8s/overlays/${{ inputs.namespace }}
kubectl rollout status deployment/sneakycrow-${{ inputs.namespace }} -n ${{ inputs.namespace }} --timeout=2m