[C8 BE*] CI/CD Actions v4 #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CICD Deployment API to Elastic Beanstalk | |
on: | |
push: | |
branches: | |
- Ch8BE | |
jobs: | |
build-and-deploy: | |
runs-on: [ ubuntu-latest ] | |
steps: | |
- name: Checkout Source | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Install Dependencies | |
run: npm install | |
- name: Build Project | |
run: npm run build | |
- name: Genrate Deployment Package | |
run: zip -r nodejs-app-build.zip . | |
- name: Deploy to EB | |
uses: einaregilsson/beanstalk-deploy@v22 | |
with: | |
aws_access_key: ${{ secrets.AWS_ACCESS_KEY }} | |
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
application_name: 'Car-Challenge8-API' | |
environment_name: 'car-challenge8-api-env' | |
version_label: ${{ github.sha }} | |
region: us-east-1 | |
deployment_package: nodejs-app-build.zip |