-
Notifications
You must be signed in to change notification settings - Fork 6
42 lines (34 loc) · 1.27 KB
/
apply.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
name: Apply the changes to Kubernetes
on:
push:
branches:
- master
jobs:
apply:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Install doctl
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- name: Patching the infrastructure
env:
K8S_CLUSTER_ID: ${{ secrets.K8S_CLUSTER_ID }}
LARAVEL_APP_SECRET: ${{ secrets.LARAVEL_APP_SECRET }}
run: |
set -e
# Installs the kubectl CLI tool.
curl -LO "https://storage.googleapis.com/kubernetes-release/release/v1.18.0/bin/linux/amd64/kubectl"
chmod +x ./kubectl && sudo mv ./kubectl /usr/local/bin/kubectl
# Installs Kustomize.
curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash
chmod +x ./kustomize && sudo mv ./kustomize /usr/local/bin/kustomize
# Save the kubeconfig to connect our kubectl to our cluster.
doctl kubernetes cluster kubeconfig save ${K8S_CLUSTER_ID}
# Create the Laravel app secret file.
echo "$LARAVEL_APP_SECRET" > .env
# Deploy!
./deploy.sh
# Clean up
rm .env