Coder Social home page Coder Social logo

approven's Introduction

Deploy to Google Cloud Storage as Website

A step that deploys website to Google Cloud Storage.

It requires a .boto config file on the root of the repository, and requires gs_oauth2_refresh_token and default_project_id lines in .boto like below:

[Credentials]
gs_oauth2_refresh_token =
[GSUtil]
default_project_id =

see: https://cloud.google.com/storage/docs/gsutil/commands/config

It applies gzip content-encoding to file uploads with below extensions.

  • css
  • html
  • js
  • json
  • map
  • svg
  • txt
  • xml

Options

required

  • bucket - A bucket name of the Google Cloud Storage.
  • project - A project ID of the Google Cloud Platform.
  • token - The OAuth 2.0 refresh token of the Google account to use for deployment.

options

  • dir - A path to directory that is root of the website. The default value is public.

initialize options

  • initialize - A flag for initialize a bucket of the Google Cloud Storage via gsutil mb command. Not empty is True.
  • class - A bucket storage class of the Google Cloud Storage.
  • location - A bucket location of the Google Cloud Storage.

see: https://cloud.google.com/storage/docs/gsutil/commands/mb#bucket-locations

It will be created with the default (Standard) storage class. It will be set the MainPageSuffix property to index.html and the NotFoundPage property to 404.html.

Example

deploy:
  steps:
  - michilu/gcs-website-deploy:
    bucket:   example.com
    project:  $GOOGLE_PROJECT_ID
    token:    $GOOGLE_REFRESH_TOKEN

    # options
    dir:      public

    # if you want to initialize a bucket
    initialize: not_empty
    class:      DURABLE_REDUCED_AVAILABILITY
    location:   ASIA-EAST1

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.