-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (42 loc) · 1.51 KB
/
rust-containers-k8s.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
name: Build and Deploy Rust Microservices
run-name: ${{ github.actor }} building and deploying Rust microservices 🚀
on:
push:
branches:
- "main"
paths:
- "rust-containers-k8s/**"
pull_request:
branches:
- "main"
paths:
- "rust-containers-k8s/**"
jobs:
build-and-push:
name: Build, push and deploy 🏗️🚀
runs-on: ubuntu-latest
defaults:
run:
working-directory: rust-containers-k8s
steps:
- name: Check out repository code
uses: actions/checkout@v4
- run:
echo "💡 The ${{ github.repository }} repository has been cloned to
the runner."
- name: get google-cloud-sdk-gke-gcloud-auth-plugin
uses: cobraz/setup-gke-gcloud-auth-plugin@v1
- name: Authenticate with GCR
run: |
echo ${{ secrets.GCR_KEY_RUST }} | base64 --decode > gcr-key.json
gcloud auth activate-service-account --key-file=gcr-key.json
gcloud auth configure-docker europe-west2-docker.pkg.dev
gcloud container clusters get-credentials platform-poc-rust-cluster --location europe-west2 --project platform-poc-rust
- name: Build and push Docker images
run: ./scripts/build_and_push.sh
- name: Set short sha
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: run helm upgrade
run: ./scripts/helm_upgrade.sh ${{ steps.vars.outputs.sha_short }}
- run: echo "🍏 Job's status is ${{ job.status }}."