Github ActionsからGCSにzipファイルをアップロードするyamlファイルの例です。
setup-gcloud@master にはGCPの認証情報を設定します。
name: workflow
on:
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
upload_file_gcs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: google-github-actions/setup-gcloud@master
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
service_account_key: ${{ secrets.GCP_SA_KEY }}
export_default_credentials: true
- name: create zip
working-directory: ./
run: zip -r ./functions.zip ./functions/function.go ./go.mod
- id: upload-file
uses: google-github-actions/upload-cloud-storage@main
with:
path: ./functions.zip
destination: bucket_name/functions
参考
Cloud Storage Uploader - GitHub Marketplace
Upload files or folders to GCS buckets
コメント