-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (45 loc) · 1.79 KB
/
github-actions-upload-to-gcp-storage.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
53
54
55
56
57
58
# ----------
# References
# ----------
# Replace folder using upload-cloud-storage action
# https://stackoverflow.com/questions/68373383/replace-folder-using-upload-cloud-storage-action
# rsync - Synchronize content of two buckets/directories
# https://cloud.google.com/storage/docs/gsutil/commands/rsync
# setup-gcloud GitHub Action
# https://github.com/google-github-actions/setup-gcloud
# Google GitHub Actions: auth
# https://github.com/google-github-actions/auth
# Deploy To Google Cloud Run Using Github Actions
# https://towardsdatascience.com/deploy-to-google-cloud-run-using-github-actions-590ecf957af0
# Github actions actions/checkout@v2 lfs: true flag not converting pointers to actual files
# https://stackoverflow.com/questions/61463578/github-actions-actions-checkoutv2-lfs-true-flag-not-converting-pointers-to-act
# Only run job on specific branch with GitHub Actions
# https://stackoverflow.com/questions/58139406/only-run-job-on-specific-branch-with-github-actions
name: Upload Files to GCP Storage
on:
push:
branches:
- main
jobs:
Upload-NYC-Street-Flooding-Analysis-Book-Files:
name: Copy latest files to GCP Storage
runs-on: ubuntu-latest
# Add "id-token" with the intended permissions.
permissions:
contents: 'read'
id-token: 'write'
steps:
- name: Checkout
uses: actions/checkout@v3
with:
lfs: true
- name: Checkout LFS files
run: git lfs checkout
- id: 'auth'
uses: google-github-actions/auth@v0
with:
credentials_json: ${{ secrets.GCP_CREDENTIALS }}
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v0'
- name: 'Use glcloud CLI'
run: 'gsutil -m rsync -r -d analysis-book/_build/html gs://nyc_street_flooding_analysis_nb_bucket_00'