Skip to content

Commit

Permalink
Merge pull request #18 from LifeRaftRisk/allow-setting-config
Browse files Browse the repository at this point in the history
Allow configuration variables to be set during deployment
  • Loading branch information
aguilinger authored May 16, 2023
2 parents 454558e + de42c5c commit 386b3a2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ The following inputs can be used as `step.with` keys

- `private_registry_username` - the username for the private registry to pull a docker image from
- `private_registry_password` - the password for the private registry to pull a docker image from
- `config_variables` - a space separated list of key=value pairs to set as config variables on the app during deployment

## Outputs

Expand All @@ -51,6 +52,7 @@ jobs:
docker_img: <docker image name>
private_registry_username: ${{ secrets.DOCKERHUB_USERNAME }}
private_registry_password: ${{ secrets.DOCKERHUB_TOKEN }}
config_variables: KEY1=value1 KEY2=value2
```
## Example with Container Build and Docker Hub
Expand Down Expand Up @@ -99,4 +101,5 @@ jobs:
docker_img: ${{ env.IMAGE_NAME }}
private_registry_username: ${{ secrets.DOCKERHUB_USERNAME }}
private_registry_password: ${{ secrets.DOCKERHUB_TOKEN }}
config_variables: RELEASE_SHA=${{ github.sha }}
```
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ inputs:
private_registry_password:
description: 'Private Registry Password'
required: False
config_variables:
description: 'Configuration variables to set on deploy'
required: False
outputs:
status:
description: "The Success/Failure of the action"
Expand Down
3 changes: 2 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,5 @@ aptible deploy --environment "$INPUT_ENVIRONMENT" \
--app "$INPUT_APP" \
--docker-image "$INPUT_DOCKER_IMG" \
--private-registry-username "$INPUT_PRIVATE_REGISTRY_USERNAME" \
--private-registry-password "$INPUT_PRIVATE_REGISTRY_PASSWORD"
--private-registry-password "$INPUT_PRIVATE_REGISTRY_PASSWORD" \
${INPUT_CONFIG_VARIABLES}

0 comments on commit 386b3a2

Please sign in to comment.