Skip to content

GitHub Action to substitute the values of environment variables using envsubst

License

Notifications You must be signed in to change notification settings

nowactions/envsubst

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Action: envsubst

Test Release License

This GitHub Action substitutes the values of environment variables using envsubst. This Action is provided as a Docker action, so it works only on Linux machines. For more information on types of actions, see the actions documentation

Usage

Prerequisites

Create a workflow .yml file in your .github/workflows directory. An example workflow is available below. For more information, reference the GitHub Help Documentation for Creating a workflow file.

Inputs

  • input: Path to the input file
  • output: Path to the output file

Example

name: Deploy app to Kubernetes

on:
  push:
    branch:
      - master

jobs:
  deploy:
    name: Deploy app to Kubernetes
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v1

      - name: Build and Push Docker image
        run: ./scripts/image
        env:
          IMAGE_TAG: gcr.io/myprj/app:${{ github.sha }}

      - name: Render Deployment YAML
        uses: nowactions/envsubst@v1
        with:
          input: ./deployment.yaml.tmpl
          output: ./deployment.yaml
        env:
          IMAGE_TAG: gcr.io/myprj/app:${{ github.sha }}
          REPLICAS: 3

      - name: Deploy
        run: kubectl apply -f ./deployment.yaml

Development

Release

  • Bump up the version in Dockerfile
  • Commit the changes
  • Run make release

About

GitHub Action to substitute the values of environment variables using envsubst

Resources

License

Stars

Watchers

Forks

Packages

No packages published