forked from atharvatechnology/apex-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (32 loc) · 1.27 KB
/
gcloud-upscale.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
name: Schedule server increase
on:
schedule:
#- cron: "15 00 * * 06"
- cron: "15 09 * * 00"
workflow_dispatch:
jobs:
upscale:
name: increase server capacity
runs-on: ubuntu-latest
environment: deployment
permissions:
contents: 'read'
id-token: 'write'
steps:
- uses: 'actions/checkout@v3'
- id: 'auth'
name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@v1'
with:
workload_identity_provider: 'projects/798920531034/locations/global/workloadIdentityPools/githubaction-pool/providers/my-provider'
service_account: '[email protected]'
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v1'
- name: 'Upgrade sql instance'
run: 'gcloud sql instances patch ${{ secrets.GCP_SQL_INSTANCE }} --tier=db-custom-4-15360 --quiet'
- name: 'stop instance'
run: 'gcloud compute instances stop instance-1 --zone us-central1-a'
- name: 'change machine type'
run: 'gcloud compute instances set-machine-type instance-1 --zone us-central1-a --machine-type c2d-highcpu-4'
- name: 'start instance'
run: 'gcloud compute instances start instance-1 --zone us-central1-a'