-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (45 loc) · 1.33 KB
/
deploy.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
52
name: features.geoconnex.dev pygeoapi build
on:
push:
branches:
- "main"
paths:
- "pygeoapi/**"
env:
REGISTRY: reference-features
DATABASE: hosted-features
DBUSER: root
jobs:
upload-file:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Generate sql data
uses: cgs-earth/[email protected]
with:
username: ${{ secrets.HYDRO_USERNAME }}
password: ${{ secrets.HYDRO_PASSWORD }}
db: ${{ env.DATABASE }}
dbuser: ${{ env.DBUSER }}
resource: 495b65e56e994289baaa5feeb401358e
- name: Set up Cloud SDK
uses: "google-github-actions/auth@v2"
with:
credentials_json: ${{ secrets.GCP_SA_TOKEN }}
- name: Upload backup to GCP Bucket
id: upload-files
uses: google-github-actions/upload-cloud-storage@v2
with:
path: .
destination: ${{ env.REGISTRY }}
gzip: false
parent: false
glob: "**/*.sql.gz"
headers: |-
content-type: application/x-gzip
- name: Push to mysql
run: |-
gcloud sql import sql ${{ env.REGISTRY }} gs://${{ env.REGISTRY }}/${{ env.DATABASE }}.sql.gz \
--database=${{ env.DATABASE }} \
--user=${{ env.DBUSER }}