-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (47 loc) · 1.55 KB
/
deploy-app.yaml
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Deploy App
on:
workflow_dispatch:
inputs:
environment:
description: "Publish to environment"
required: true
default: "internal"
type: choice
options:
- internal
- alpha
- production
- cluster-core
jobs:
information:
runs-on: ubuntu-latest
steps:
- name: Extract branch name
shell: bash
run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >>$GITHUB_OUTPUT
id: extract_branch
- name: Adding markdown
run: |
echo '
🚀 Deploying to **${{ inputs.environment }}** from **${{ steps.extract_branch.outputs.branch }}**
' >> $GITHUB_STEP_SUMMARY
deploy:
runs-on: ubuntu-latest
environment: DigitalOcean
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Build
run: yarn build:k8s:${{ inputs.environment }}
- uses: imranismail/setup-kustomize@v2
- name: Install doctl
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITAL_OCEAT_TOKEN }}
- name: Save DigitalOcean kubeconfig with short-lived credentials
run: doctl kubernetes cluster kubeconfig save --expiry-seconds 600 ${{ secrets.DIGITALOCEAN_CLUSTER_ID }}
- uses: azure/setup-kubectl@v3
- name: Show diff
run: kubectl diff -f ./${{ inputs.environment }}.yaml | grep -e "^\+ " -e "^- "
- name: Deploy
run: kubectl apply -f ./${{ inputs.environment }}.yaml -n democracy-${{ inputs.environment }}