Giter Site home page Giter Site logo

zxyle / publish-gae-action Goto Github PK

View Code? Open in Web Editor NEW
23.0 2.0 1.0 253 KB

publish application to GAE in your GitHub workflow.

Home Page: https://github.com/marketplace/actions/publish-app-to-google-app-engine

License: MIT License

JavaScript 100.00%
google-app-engine continuous-deployment gcloud-sdk github-actions

publish-gae-action's Introduction

publish-gae-action

Build Status

This action allowed you publish application to Google App Engine.

Example

This project uses this action to published to Google App Engine.

BoardCAM.org

Usage

- name: Initialize Google Cloud SDK
  uses: zxyle/publish-gae-action@master
  with:
    service_account_email: ${{ secrets.GCP_SA_EMAIL }}
    service_account_key: ${{ secrets.GCP_SA_KEY }}
    project_id: ${{ secrets.PROJECT_ID }}
    # An optional variables parameter can be used
    gae_variables: ${{ secrets.GAE_VARIABLES }}

- name: Publish app to Google App Engine
  run: |
    # This client-secret.json is converted by GCP_SA_KEY.
    gcloud auth activate-service-account ${{ secrets.GCP_SA_EMAIL }} --key-file=client-secret.json
    gcloud config set project ${{ secrets.PROJECT_ID }}
    gcloud -q app deploy app.yaml --promote
    
    # Suppose you need a cron task.
    gcloud -q app deploy cron.yaml

Inputs

  • service_account_email: (Required) The service account email which will be used for authentication.

  • service_account_key: (Required) The service account key which will be used for authentication. This key should be created, encoded as a Base64 string (eg. cat my-key.json | base64 on macOS or Linux), and stored as a secret.

  • project_id: (Required) The project_id is google cloud platform project id. See this page to get it.

  • gae_variables: (Optional) App engine variables. This should be a json object encoded as a base64 string. This will be written into the app.yaml file at the root of your project. A sample variable file is shown here.

  • gae_config_path: (Optional) Path to the app.yml to use (./my/neseted/package/app.yml). Defaults to ./app.yml.

Note

Use 272.0.0 Google Cloud SDK by default on GitHub-hosted runners. If you need latest version, please refer to this action. But in most cases, this is enough.

Possible Errors

WARNING: You do not appear to have access to project [project-id] or it does not exist.

You must activate the Cloud Resource Manager API, to be fix this issue. Just replace YOUR_PROJECT_ID_HERE of the link bellow and click ENABLE.

https://console.developers.google.com/apis/api/cloudresourcemanager.googleapis.com/overview?project=YOUR_PROJECT_ID_HERE

Sample variable file

{
  "beta_settings": {
    "cloud_sql_instances": "my_sql_instance"
  },
  "env_variables": {
    "DB_CONNECTION": "mysql",
    "DB_HOST": "127.0.0.1",
    "DB_PORT": 3306,
    "DB_USER": "mydbuser",
    "DB_DATABASE": "my_database",
    "DB_PASSWORD": "password",
    "DB_SOCKET": "/cloudsql/mys_sql_instance"
  }
}

On a Mac you can encode this into a base64 string by running the following command;

base64 -i myvariables.json

License

The scripts and documentation in this project are released under the MIT License

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.