Skip to content

Commit 5acffbd

Browse files
Create sync-to-gcs.yml
1 parent 8d3fbba commit 5acffbd

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

.github/workflows/sync-to-gcs.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Sync Folders to Google Cloud Storage
2+
3+
permissions:
4+
id-token: write
5+
contents: read
6+
7+
on:
8+
push:
9+
branches:
10+
- main
11+
12+
jobs:
13+
sync-to-gcs:
14+
environment: production
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: 'read'
18+
id-token: 'write'
19+
20+
steps:
21+
# Checkout the repository
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
# Authenticate to Google Cloud
26+
- id: auth
27+
name: Authenticate to Google Cloud
28+
uses: google-github-actions/auth@v2
29+
with:
30+
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
31+
32+
# Set up Google Cloud SDK
33+
- name: Set up Cloud SDK
34+
uses: google-github-actions/setup-gcloud@v2
35+
with:
36+
project_id: ${{ secrets.GCP_PROJECT_ID }}
37+
38+
# Sync blockchains folder
39+
- name: Sync blockchains folder
40+
run: gsutil -m rsync -r -d -c blockchains gs://${{ secrets.GCP_BUCKET_NAME }}/blockchains
41+
42+
# Sync demex folder
43+
- name: Sync demex folder
44+
run: gsutil -m rsync -r -d -c demex gs://${{ secrets.GCP_BUCKET_NAME }}/demex
45+
46+
# Sync tokens folder
47+
- name: Sync tokens folder
48+
run: gsutil -m rsync -r -d -c tokens gs://${{ secrets.GCP_BUCKET_NAME }}/tokens

0 commit comments

Comments
 (0)