Skip to content

Commit

Permalink
Create .env from ENV_FILE secret in docker-compose-test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
vishnuravi committed Nov 21, 2023
1 parent f796d4f commit 19dd366
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/docker-compose-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ on:
description: 'Optional path or name to a test script to test the Docker compose setup'
required: false
type: string
secrets:
ENV_FILE:
description: 'Contents of a .env file'
required: false

jobs:
buildandtest:
Expand All @@ -37,6 +41,9 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create .env file
run: |
echo "${{ secrets.ENV_FILE }}" > ${{ github.workspace }}/.env
- name: Docker compose up
run: docker-compose -f ${{ inputs.workingDirectory }}/${{ inputs.dockerComposeFile }} up -d --build
- name: Run test script
Expand Down

0 comments on commit 19dd366

Please sign in to comment.