-
Notifications
You must be signed in to change notification settings - Fork 12
71 lines (60 loc) · 2.41 KB
/
at_server_dev_deploy.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: at_root deploy (dev)
on:
push:
branches:
- trunk
paths:
- packages/*_root_server/**
permissions: # added using https://github.com/step-security/secure-workflows
contents: read
jobs:
Docker_Build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
# Extract branch for docker tag
- name: Get branch name
run: echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
- name: Login to DockerHub
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# Build the Docker image for Dev
- name: Build and push
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
with:
file: packages/at_root_server/Dockerfile
context: packages/at_root_server
push: true
tags: |
atsigncompany/root:dev_env
atsigncompany/root:dev_env-${{ env.BRANCH }}-gha${{ github.run_number }}
Deploy_On_Dev_K8:
needs: Docker_Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
# Extract branch for docker tag
- name: Get branch name
run: echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
# Setup gcloud CLI
- id: 'auth'
uses: google-github-actions/auth@35b0e87d162680511bf346c299f71c9c5c379033 # v1.1.1
with:
credentials_json: '${{ secrets.GKE_SA_DEV_KEY }}'
- name: 'Set up Cloud SDK'
uses: google-github-actions/setup-gcloud@e30db14379863a8c79331b04a9969f4c1e225e0b # v1.1.1
# Get the GKE credentials so we can deploy to the cluster
- uses: google-github-actions/get-gke-credentials@35ab0d2b2d48792c19f09325413bd185c8d44394 # v1.0.2
with:
cluster_name: ${{ secrets.GKE_DEV_CLUSTER }}
location: ${{ secrets.GKE_DEV_ZONE }}
# Deploy the Docker image to the GKE cluster
- name: Deploy
run: |-
kubectl -n root set image statefulset root root=atsigncompany/root:dev_env