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