Code Monkey home page Code Monkey logo

gcp-storage-sync's Introduction

GitHub Action to GCP Storage Bucket

This simple action uses the gsutil tool to sync a directory (either from your repository or generated during your workflow) with a remote GCP Storage bucket

Usage

workflow.yml

Place in a .yml file such as this one in your .github/workflows folder. Refer to the documentation on workflow YAML syntax here.

Mostly gsutil rsync flags are optional to allow for maximum customizability and must be provided by you via args:

Example

  • -d mirror source and destination. See.
name: gcp-storage-sync

on:
  push:
    branches:
      - master

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: omppye-tech/gcp-storage-sync@master
        with:
          args: -d
        env:
          GCP_SERVICE_ACCOUNT_KEY_FILE: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY_FILE }}
          GCP_STORAGE_BUCKET: ${{ secrets.GCP_STORAGE_BUCKET }}
          SOURCE_DIR: "public"

Configuration

The following settings must be passed as environment variables as shown in the example. Sensitive information, especially GCP_SERVICE_ACCOUNT_KEY_FILE, should be set as encrypted secrets โ€” otherwise, they'll be public to anyone browsing your repository's source code and CI logs

Key Value Suggested Type Required Default
GCP_SERVICE_ACCOUNT_KEY_FILE Your JSON GCP service account key file. More info here Secret ENV Yes N/A
GCP_STORAGE_BUCKET Your GCP Storage bucket name For example, my-project Secret ENV Yes N/A
SOURCE_DIR The local directory (or file) you wish to sync/upload to GCP Storage. For example, public ENV Yes N/A
DEST_DIR The directory inside of the GCP Storage bucket you wish to sync/upload to. For example, my_project/assets. Defaults to the root of the bucket ENV No / (root of bucket)

License

This project is distributed under the MIT license

Thanks to s3-sync

gcp-storage-sync's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.