changed yml #3
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
# Workflow 'CI': This workflow is designed to perform continuous integration. | |
# On every push to the 'main' branch, it runs Cypress tests on the latest version of Ubuntu. | |
# If the tests pass, it deploys the application to AWS Elastic Beanstalk. | |
name: CICD | |
on: | |
push: | |
branches: | |
- test-CICD | |
jobs: | |
cypress-run: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 16 | |
- name: Install Dependencies | |
run: npm ci | |
- name: Run Cypress Tests | |
uses: cypress-io/github-action@v2 | |
with: | |
start: npm run dev | |
wait-on: 'http://localhost:3000' | |
deploy: | |
needs: cypress-run | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Deploy to Elastic Beanstalk | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_REGION: 'us-east-1' | |
run: | | |
pip install awscli | |
aws elasticbeanstalk update-environment \ | |
--application-name Test \ | |
--environment-name Test-env \ | |
--version-label 2.0.0 |