From 09d1b18424394e01cb351f151bfacdbf4c707d36 Mon Sep 17 00:00:00 2001 From: Khanh Nguyen Date: Thu, 26 Oct 2023 14:11:39 -0400 Subject: [PATCH] Migrating from GitHub Actions -> Cloud Build (#118) * cloudbuild.yaml for upload to TEST GCS bucket. * test * add -m flag to upload in parallel * flags should be combined * recursively copy folder * remove GCS Upload GitHub action * replace gcs bucket uri * add test line in comments --- .github/workflows/gcs.yml | 34 ---------------------------- cloudbuild/gcs.yaml | 5 ++++ surveys/flutter-survey-metadata.json | 3 ++- 3 files changed, 7 insertions(+), 35 deletions(-) delete mode 100644 .github/workflows/gcs.yml create mode 100644 cloudbuild/gcs.yaml diff --git a/.github/workflows/gcs.yml b/.github/workflows/gcs.yml deleted file mode 100644 index b1ee7b6..0000000 --- a/.github/workflows/gcs.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: GCS - -on: - push: - branches: - - master - pull_request: - branches: - - master - schedule: - - cron: "0 0 * * 0" - -# Declare default permissions as read only. -permissions: read-all - -jobs: - upload-surveys: - runs-on: ubuntu-latest - if: | - github.event_name == 'push' - && github.ref == 'refs/heads/master' - && github.repository == 'flutter/uxr' - steps: - - id: Checkout - uses: actions/checkout@v3 - - id: 'auth' - uses: 'google-github-actions/auth@v0' - with: - credentials_json: '${{ secrets.SERVICE_KEY }}' - - id: 'upload-file' - uses: 'google-github-actions/upload-cloud-storage@v0' - with: - path: 'surveys' - destination: 'flutter-uxr' diff --git a/cloudbuild/gcs.yaml b/cloudbuild/gcs.yaml new file mode 100644 index 0000000..5749817 --- /dev/null +++ b/cloudbuild/gcs.yaml @@ -0,0 +1,5 @@ +steps: +- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk' + args: ['gsutil', 'cp', '-r', 'surveys', 'gs://flutter-uxr/'] +options: + logging: CLOUD_LOGGING_ONLY diff --git a/surveys/flutter-survey-metadata.json b/surveys/flutter-survey-metadata.json index 0fac3c3..e9b6d18 100644 --- a/surveys/flutter-survey-metadata.json +++ b/surveys/flutter-survey-metadata.json @@ -2,7 +2,8 @@ "_comments": [ "uniqueId must be updated with each new survey so IDEs know to re-prompt users.", "title should not exceed 45 characters.", - "startDate and endDate should follow ISO 8601 standard with a timezone offset." + "startDate and endDate should follow ISO 8601 standard with a timezone offset.", + "TEST" ], "uniqueId": "2023Q4", "title": "Help improve Flutter! Take our Q4 survey.",