diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml new file mode 100644 index 0000000..5845fed --- /dev/null +++ b/.github/workflows/cicd.yml @@ -0,0 +1,34 @@ +name: CI/CD + +on: + push: + branches: + - main + +jobs: + build-deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set Up Node.js + uses: actions/setup-node@v3 + with: + node-version: '20' + + - name: Install and Build + run: | + npm install + npm run build + + - name: Deploy to S3 + uses: aws-actions/configure-aws-credentials@v2 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: Upload to S3 + run: | + aws s3 sync ./dist/ s3://${{ secrets.AWS_S3_BUCKET }} --delete