diff --git a/.github/workflows/teardown.yml b/.github/workflows/teardown.yml index f787530..a94fecf 100644 --- a/.github/workflows/teardown.yml +++ b/.github/workflows/teardown.yml @@ -8,10 +8,8 @@ on: required: true jobs: - Teardown: - + deploy: runs-on: ubuntu-latest - steps: - uses: actions/checkout@v3 @@ -19,9 +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: Teardown 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 }}" - terraform init - terraform destroy -auto-approve + terraform init + terraform destroy -auto-approve + rm credentials.txt