GithubHelp home page GithubHelp logo

create-app.yaml-action's Introduction

Create Google App Engine yaml file

This action creates an app.yaml (or named however you decide) file to be used with Google App Engine when deploying via Github Actions. It creates the file and saves it to your desired location. The file is populated with env variables that you pass when calling the action from a Github Actions workflow. This allows you to exclude your app.yaml file from source control, which is a more secure way to work.

Inputs

filename

Optional: The name of the file. Defaults to "app.yaml".

directory

Optional: The directory where to save the file relative to the root of the workspace. Defaults to the root of the workspace.

Example usage

name: Deploy to GAE

on:
  push:
    branches: [main]

jobs:
  deploy:
    name: Deploying to Google Cloud
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Authenticate to Google Cloud
        id: auth
        uses: google-github-actions/auth@v1
        with:
          credentials_json: ${{ secrets.GCP_CREDENTIALS }}

      - name: Write app.yaml file
        uses: svegalopez/create-app-yaml-action@main
        with:
          filename: app.yaml
          directory: backend
        env:
          VALUE_runtime: nodejs18
          ENVKEY_MY_URL: https://api.something.com
          ENVKEY_MY_SECRET: ${{ secrets.MY_SECRET }}

      - name: Deploy to App Engine
        id: deploy
        uses: google-github-actions/deploy-appengine@v1
        with:
          working_directory: backend
          deliverables: app.yaml
          project_id: ${{ secrets.GCP_PROJECT }}

The above would result in an app.yaml file that looks like this:

runtime: nodejs18
env_variables:
  MY_URL: "https://daring-solstice-386914.uc.r.appspot.com"
  MY_SECRET: "thisIsTh3Secret"

As you can see, prefixing a value with "VALUE_" causes it to be injected as a configuration parameter of the app.yaml file. Prefixing a value with "ENVKEY_" will cause it to be injected as an environment variable (under the env_variables section) of the file.

create-app.yaml-action's People

Contributors

svegalopez avatar

Watchers

 avatar

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.