gokiwibot / gcp-yaml-compiler

Safe storage of environment variables in Google App Engine with file.yaml

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Safe storage of environment variables in Google App Engine with file.yaml

Note: This action is a custom add-on made to enrich deploy-appengine

The action will help you to solve the following problems:

  1. If you need to store API keys or other sensitive information in your .yaml as environment variables for deployment on Google App Engine.
  2. If you don't like the idea to push secret environment variables your .yaml to GitHub.
  3. If you don't like the idea to store the environment variables in a datastore.

Action swaps environment variables in your file.yaml with the minimal effort

  1. Modify your < NAME >.yaml file:

     env_variables:
       KEY1: $KEY1
       KEY2: $KEY2
    
  2. Add this action to your workflow:

     - uses: gokiwibot/gcp-yaml-compiler@v1.0
       with:
         file: ./< NAME >.yaml
       env:
         KEY1: ${{ secrets.KEY1 }}
         KEY2: ${{ secrets.KEY2 }}
    

Note: If you do not add a file it will automatically pick app.yaml as default

Full example with deployment to Google App Engine:

deploy:
    name: Deploy
    runs-on: ubuntu-latest
    needs: [build]
steps:
    - uses: actions/checkout@v2
    # Replace variables
    - uses: gokiwibot/gcp-yaml-compiler@v1.0
      with:
        file: ./< NAME >.yaml
      env:
        KEY1: ${{ secrets.KEY1 }}
        KEY2: ${{ secrets.KEY2 }}
    # Deploy to GAE
    - name: Authenticate with GCP
      uses: 'google-github-actions/auth@v0'
      with:
        credentials_json: '${{ secrets.GCP_SERVICE_ACCOUNT }}'
    - name: Deploy to Google App Engine
      uses: google-github-actions/deploy-appengine@v0
      with:
        deliverables: < NAME >.yaml

Development getting started

This is an example of how you may set up the project locally.

Option 1

Prerequisites

Option 2

Prerequisites

Installation

After you completed any of the previous options

  1. Install dependencies
    go get -d -v
  2. Run the project
    go run main.go

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/NewFeature)
  3. Commit your Changes (git commit -m 'Add some NewFeature')
  4. Push to the Branch (git push origin feature/NewFeature)
  5. Open a Pull Request

About

Safe storage of environment variables in Google App Engine with file.yaml

License:MIT License


Languages

Language:Go 78.8%Language:Dockerfile 21.2%