Skip to content

Commit

Permalink
ammended workflows for easier parsing in of creds
Browse files Browse the repository at this point in the history
  • Loading branch information
86LAK committed Apr 30, 2024
1 parent 9682903 commit 19e25f9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 30 deletions.
19 changes: 5 additions & 14 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,8 @@ name: Manual AWS Deployment
on:
workflow_dispatch:
inputs:
awsAccessKeyId:
description: 'AWS Access Key ID'
required: true
awsSecretAccessKey:
description: 'AWS Secret Access Key'
required: true
awsSessionToken:
description: 'AWS Session Token'
awsCredentials:
description: 'AWS Credentials'
required: true

jobs:
Expand All @@ -28,10 +22,7 @@ jobs:

- name: Deploy to AWS
run: |
echo "::add-mask::${{ github.event.inputs.awsAccessKeyId }}"
echo "::add-mask::${{ github.event.inputs.awsSecretAccessKey }}"
echo "::add-mask::${{ github.event.inputs.awsSessionToken }}"
export AWS_ACCESS_KEY_ID=${{ github.event.inputs.awsAccessKeyId }}
export AWS_SECRET_ACCESS_KEY=${{ github.event.inputs.awsSecretAccessKey }}
export AWS_SESSION_TOKEN=${{ github.event.inputs.awsSessionToken }}
echo "${{ github.event.inputs.awsCredentials }}" > credentials.txt
export $(cat credentials.txt | xargs)
rm credentials.txt
./deploy.sh
22 changes: 6 additions & 16 deletions .github/workflows/teardown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,8 @@ name: Manual AWS Teardown
on:
workflow_dispatch:
inputs:
awsAccessKeyId:
description: 'AWS Access Key ID'
required: true
awsSecretAccessKey:
description: 'AWS Secret Access Key'
required: true
awsSessionToken:
description: 'AWS Session Token'
awsCredentials:
description: 'AWS Credentials'
required: true

jobs:
Expand All @@ -25,14 +19,10 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 20.x

- name: Teardown to AWS
run: |
run: |
echo "::add-mask::${{ github.event.inputs.awsAccessKeyId }}"
echo "::add-mask::${{ github.event.inputs.awsSecretAccessKey }}"
echo "::add-mask::${{ github.event.inputs.awsSessionToken }}"
export AWS_ACCESS_KEY_ID=${{ github.event.inputs.awsAccessKeyId }}
export AWS_SECRET_ACCESS_KEY=${{ github.event.inputs.awsSecretAccessKey }}
export AWS_SESSION_TOKEN=${{ github.event.inputs.awsSessionToken }}
echo "${{ github.event.inputs.awsCredentials }}" > credentials.txt
export $(cat credentials.txt | xargs)
rm credentials.txt
./teardown.sh

0 comments on commit 19e25f9

Please sign in to comment.