Skip to content
This repository has been archived by the owner on Nov 12, 2023. It is now read-only.

Commit

Permalink
Initial Release
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Richter <[email protected]>
  • Loading branch information
danielr1996 committed Dec 24, 2019
0 parents commit 2e31f00
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/pipeline.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Build Pipeline

on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
# - uses: ./
# with:
# input: template.json
# output: deployment.json
# env:
# VERSION: 1.2.3
# INSTANCE: dev/develop
# - run: cat deployment.json
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea/
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM alpine
RUN apk --update add gettext
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod a+x /usr/local/bin/entrypoint.sh
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Envsubst Action

This action allows you to substitute environment variables in a file.

## Usage

template.json
```json
{
"version": "${VERSION}",
"instance": "${INSTANCE}"
}
```

.github/workflows/pipeline.yaml
```yaml
- uses: danielr1996/[email protected]
with:
input: template.json
output: deployment.json
env:
VERSION: 1.2.3
INSTANCE: staging
```
deployment.json
```json
{
"version": "1.2.3",
"instance": "staging"
}
```
16 changes: 16 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: 'envsubst-action'
description: wrapper for envsubst
author: 'Daniel Richter'
branding:
icon: 'terminal'
color: 'yellow'
inputs:
input:
description: 'File to run substitutions on'
required: true
output:
description: 'File to write result to'
required: true
runs:
using: 'docker'
image: 'Dockerfile'
3 changes: 3 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
set -e
envsubst < $INPUT_INPUT > $INPUT_OUTPUT

0 comments on commit 2e31f00

Please sign in to comment.