From 38ca437399074bda3c71deef92ea6ee3d418373b Mon Sep 17 00:00:00 2001 From: "86.LAK" Date: Fri, 24 May 2024 07:30:02 +1000 Subject: [PATCH] reployment workflow --- .github/workflows/redeployment.yml | 35 ++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/redeployment.yml diff --git a/.github/workflows/redeployment.yml b/.github/workflows/redeployment.yml new file mode 100644 index 0000000..9473825 --- /dev/null +++ b/.github/workflows/redeployment.yml @@ -0,0 +1,35 @@ +name: Manual AWS Redeployment + +on: + workflow_dispatch: + inputs: + awsCredentials: + description: 'AWS Credentials' + required: true + environmentVariables: + description: 'Environment Variables' + required: true + + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Use Node.js 20.x + uses: actions/setup-node@v3 + with: + node-version: 20.x + - uses: levibostian/action-hide-sensitive-inputs@v1 + - name: Create .env.local + run: | + cd frontend + touch .env.local + cd .. + - name: Deploy to AWS + run: | + eval "${{ github.event.inputs.awsCredentials }}" + eval "${{ github.event.inputs.environmentVariables }}" + terraform init + terraform destroy -auto-approve + terraform apply -auto-approve