Skip to content

Commit

Permalink
chore(multi-env): improve deployment for multi-environments (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
JeanSebastienRoyIngeno authored Jun 1, 2023
1 parent 59bc0e5 commit 9c88b8c
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions .github/workflows/aws-docker-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,18 @@ on:
required: true
type: string
description: Name of the repository

dockerfile:
required: true
type: string
description: Location of the dockerfile
client-environment-file-path:
required: false
type: string
description: Location of the .env file of front-end client
dotenv-value:
required: false
type: string
description: The value needed to fill the .env

# These permissions are needed to interact with GitHub's OIDC Token endpoint.
permissions:
Expand All @@ -27,7 +34,7 @@ jobs:
uses: actions/checkout@v3

- name: Configure AWS Credentials
uses: ingeno/aws-workflows/.github/actions/configure-aws-credentials@v1
uses: ingeno/aws-workflows/.github/actions/configure-aws-credentials@v3
with:
aws-account-id: ${{ vars.SHARED_SERVICES_ACCOUNT_ID }}
aws-region: ${{ vars.AWS_REGION }}
Expand All @@ -36,8 +43,18 @@ jobs:
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1

- name: Fill .env file for frontend-client
if: ${{ inputs.client-environment-file-path && inputs.dotenv-value }}
shell: bash
run: |
echo ${{ inputs.dotenv-value }}
touch ${{ inputs.client-environment-file-path }}
echo -e "${{ inputs.dotenv-value }}" > ${{ inputs.client-environment-file-path }}
echo ".env created!"
cat ${{ inputs.client-environment-file-path }}
- name: Build, tag and Push image
uses: ingeno/aws-workflows/.github/actions/docker-deploy@v1
uses: ingeno/aws-workflows/.github/actions/docker-deploy@v3
with:
registry: ${{ vars.SHARED_SERVICES_ACCOUNT_ID }}.dkr.ecr.${{ vars.AWS_REGION }}.amazonaws.com
repository: ${{ inputs.repository }}
Expand Down

0 comments on commit 9c88b8c

Please sign in to comment.