The backend pipeline runs automatically when:
- A push is made to the
v1
branch, and the changes are within thebackend/
folder.
The backend pipeline consists of two main jobs:
This job ensures the backend code is functional and passes all tests before deployment.
Working Directory: ./backend
-
Checkout Code:
- The repository code is checked out.
-
Setup Node.js:
- Node.js is installed.
- Dependencies are cached using
package-lock.json
.
-
Install Dependencies:
- Dependencies are installed using
npm
.
- Dependencies are installed using
-
Run Tests:
- Automated tests are executed using
npm test
.
- Automated tests are executed using
If the tests pass successfully, the deployment job starts.
Working Directory: ./backend
Dependency: Relies on the test job completing successfully.
-
Checkout Code:
- The repository code is checked out.
-
Setup Node.js:
- Node.js installed.
- Dependencies are cached.
-
Install Dependencies:
- Production dependencies are installed.
-
Prepare Deployment Package:
- The package is prepared for deployment.
-
Push to Lambda:
- Using AWS credentials with appropriate permissions, the zipped package is pushed to AWS Lambda.
- All AWS credentials are stored as repository secrets on github.