-
Notifications
You must be signed in to change notification settings - Fork 52
45 lines (40 loc) · 1.59 KB
/
treetracker-webmap-server-deploy-dev.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
44
45
name: Deploy to Dev Env
on:
workflow_dispatch:
inputs:
git-tag:
description: 'tag'
required: true
env:
project-directory: ./
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
if: |
github.repository == 'Greenstand/treetracker-web-map-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: Copy kustomize.yml
run: cp ./deployment/kustomize/kustomization.yaml ./deployment/kustomization.yaml
working-directory: ${{ env.project-directory }}
- name: Run kustomize
run: (cd ./deployment/base && ../../kustomize edit set image greenstand/treetracker-web-map-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_TOKEN }}
- name: Save DigitalOcean kubeconfig
run: doctl kubernetes cluster kubeconfig save ${{ secrets.DEV_CLUSTER_NAME }}
- name: Update kubernetes resources
run: kustomize build deployment/overlays/development | kubectl apply -n webmap --wait -f -
working-directory: ${{ env.project-directory }}