generated from Greenstand/treetracker-microservice-template
-
Notifications
You must be signed in to change notification settings - Fork 59
40 lines (37 loc) · 1.44 KB
/
deploy-prod-env.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 to Prod Env
on:
workflow_dispatch:
inputs:
git-tag:
description: 'tag'
required: true
env:
project-directory: ./
jobs:
deploy:
name: Deploy, requires approval
runs-on: ubuntu-latest
if: |
github.repository == 'Greenstand/treetracker-query-api'
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.git-tag }}
- name: get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@master
- name: Install kustomize
run: curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash
working-directory: ${{ env.project-directory }}
- name: Run kustomize
run: (cd ./deployment/base && ../../kustomize edit set image greenstand/treetracker-query-api:${{ steps.package-version.outputs.current-version }} )
working-directory: ${{ env.project-directory }}
- name: Install doctl for kubernetes
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_PRODUCTION_TOKEN }}
- name: Save DigitalOcean kubeconfig
run: doctl kubernetes cluster kubeconfig save ${{ secrets.PRODUCTION_CLUSTER_NAME }}
- name: Update kubernetes resources
run: kustomize build deployment/overlays/prod | kubectl apply -n webmap --wait -f -
working-directory: ${{ env.project-directory }}