-
Notifications
You must be signed in to change notification settings - Fork 40
51 lines (42 loc) · 1.34 KB
/
prod-docs.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
46
47
48
49
50
51
name: Build and Deploy Prod Docs
on:
push:
branches:
- master
# Environment variables available to all jobs and steps in this workflow
env:
GKE_PROJECT: ${{ secrets.GKE_PROJECT }}
GKE_CLUSTER: ${{ secrets.GKE_CLUSTER }}
GKE_ZONE: ${{ secrets.GKE_ZONE }}
jobs:
setup-build-publish-deploy:
name: Setup, Build, and Deploy
runs-on: ubuntu-latest
steps:
- name: Extract branch name
shell: bash
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//-/g')" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@master
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.82.0'
extended: true
- name: Setup gcloud CLI
uses: google-github-actions/setup-gcloud@v0
with:
version: '281.0.0'
service_account_email: ${{ secrets.GCP_SA_EMAIL }}
service_account_key: ${{ secrets.GCP_SA_KEY }}
project_id: ${{ secrets.GKE_PROJECT }}
export_default_credentials: true
- name: Build
run: hugo
- name: Deploy
run: |
gcloud auth configure-docker
gcloud container clusters get-credentials $GKE_CLUSTER \
--zone $GKE_ZONE --project $GKE_PROJECT
kubectl -n webroot rollout restart deployment alpaca-docs-prod
kubectl -n webroot get pod -o wide