From 88c9a385f1ed1d16d97f268fe32e457017c001f4 Mon Sep 17 00:00:00 2001 From: 86LAK <121588258+86LAK@users.noreply.github.com> Date: Wed, 1 May 2024 18:31:10 +1000 Subject: [PATCH] Update deploy.yml --- .github/workflows/deploy.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 9e0d645..9287cc3 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -17,12 +17,20 @@ jobs: uses: actions/setup-node@v3 with: node-version: 20.x - + + - uses: levibostian/action-hide-sensitive-inputs@v1 + + - name: Set AWS Credentials as Environment Variables and Save to File + run: | + echo "$AWS_CREDENTIALS" | tr " " "\n" > credentials.txt + export $(echo "$AWS_CREDENTIALS" | tr " " "\n") + - name: Deploy to AWS + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_REGION: ${{ secrets.AWS_REGION }} run: | - echo "::add-mask::${{ github.event.inputs.awsCredentials }}" - echo "${{ github.event.inputs.awsCredentials }}" > credentials.txt - export $(cat credentials.txt | xargs) - rm credentials.txt terraform init terraform apply -auto-approve + rm credentials.txt