This repository has been archived by the owner on Nov 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Daniel Richter <danielrichter@posteo.de>
- Loading branch information
0 parents
commit 2e31f00
Showing
6 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/envsubst-action@1.0.0 | ||
with: | ||
input: template.json | ||
output: deployment.json | ||
env: | ||
VERSION: 1.2.3 | ||
INSTANCE: staging | ||
``` | ||
deployment.json | ||
```json | ||
{ | ||
"version": "1.2.3", | ||
"instance": "staging" | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
set -e | ||
envsubst < $INPUT_INPUT > $INPUT_OUTPUT |