Create CI_CD_Documentation.md #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
name: React CI/CD app | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build-react-server: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checking out code | |
uses: actions/checkout@v2 | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '16.x' | |
- name: Install dependencies | |
run: npm ci --no-optional --ignore-scripts | |
- name: Build project | |
run: | | |
export NODE_ENV=production | |
npm run build | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: us-east-1 | |
- name: Deploy to S3 bucket | |
run: | | |
aws s3 sync dist/ s3://react-app-project1 --delete |