From 132ed1af0d4f8909a32038afc47ad37a8d2c6729 Mon Sep 17 00:00:00 2001 From: leemhoon00 Date: Sun, 17 Nov 2024 19:40:30 +0900 Subject: [PATCH] build: ci script --- .github/workflows/ci.yaml | 40 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..3eb40c4 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,40 @@ +name: ci + +on: + push: + branches: + - main + +permissions: + id-token: write + contents: read + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Build + run: | + npm install + npx tsc -p tsconfig.json + npm install --omit=dev + npx prisma generate + mv node_modules dist/ + cd dist + zip -r ../dist.zip . + cd .. + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + role-to-assume: ${{ secrets.AWS_ROLE_ARN }} + role-session-name: github-actions + aws-region: ap-northeast-2 + + - name: Upload to Lambda + run: | + aws lambda update-function-code --function-name sync-openapi --zip-file fileb://dist.zip