From 5d6067c4930dc5a084fb7aa359deb13c41cff3e1 Mon Sep 17 00:00:00 2001 From: Morgan Ney Date: Thu, 28 Dec 2023 14:50:20 -0600 Subject: [PATCH] ci: add deploy workflow. --- .github/workflows/deploy.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..714ad5a --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,36 @@ +name: Deploy + +on: + workflow_dispatch: + +jobs: + deploy: + name: Deploy + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3.5.2 + - name: Setup Node + uses: actions/setup-node@v3.6.0 + with: + node-version: '20.10.0' + - name: Install Dependencies + run: npm ci + - name: Save error log + uses: actions/upload-artifact@v2 + if: ${{ failure() }} + with: + name: npm-debug-log-${{ hashFiles('package-lock.json') }} + path: npm-debug.log + - name: Build + run: npm run build + - name: Zip + run: npm run zip + - name: AWS Lambda Deploy + uses: appleboy/lambda-action@v0.1.9 + with: + aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws_region: ${{ secrets.AWS_REGION }} + function_name: restbus + zip_file: dist/restbus.zip